
Product
Redesigned Repositories Page: A Faster Way to Prioritize Security Risk
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
ProductDB back-end API
Create a virtual environment
python -m venv venv
Enter the virtual environment
source venv/bin/activate
Upgrade pip (optional)
pip install --upgrade pip
Clone the repository from GitHub
git clone git@github.com:simonsobs/acondbs.git
Install from the clone in the editable mode.
pip install -e acondbs/[tests]
Create an instance folder of Flask, where the config file and the SQLite DB file are stored. Check out an example instance folder from GitHub
git clone git@github.com:TaiSakuma/acondbs-instance-example.git instance
Set environmental variables
export FLASK_APP="acondbs:create_app('$PWD/instance/config.py')"
export FLASK_DEBUG=1
flask init-db
An SQLite DB file has been created in the instance folder (instance/product.sqlite3
). Tables were defined (The tables were empty. Only fields were defined. No data were inserted in the tables).
(Optional) Load sample data to the dababase.
flask import-csv acondbs/tests/sample/csv/
Run with the Flask built-in server for the development. (Deployment options for proudction are descriped in the Flask documentation.)
flask run
The above command starts the built-in server that only allows accress from localhost. It starts the server at the default TCP port, usually 5000
.
To allow the access from outside, use --host=0.0.0.0
option. The TCP port can be specified by --port
option. For example:
flask run --host=0.0.0.0 --port=5000
Now, you can send GraphQL requests to the server, for example, as follows.
curl -d "query={allMaps { edges { node { name mapper } } }}" localhost:5000/graphql
If you access to the server with a web browser, it will show a graphical user interface GraphiQL: http://localhost:5000/graphql
Move to the repository
cd acondbs
Run the unit tests
pytest
Run the unit tests with coverage
pytest --cov
Generate the coverage report
coverage html
The report can be found at coverage_html_report/index.html
.
FAQs
ProductDB back-end API
We found that acondbs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
Security News
Slopsquatting is a new supply chain threat where AI-assisted code generators recommend hallucinated packages that attackers register and weaponize.
Security News
Multiple deserialization flaws in PyTorch Lightning could allow remote code execution when loading untrusted model files, affecting versions up to 2.4.0.