Skip to main content

PyPI - Version PyPI - Python Version Test Status codecov

Acondbs

ProductDB back-end API

How to check out and run (for developers)

Prepare environment

Create a virtual environment

python -m venv venv

Enter the virtual environment

source venv/bin/activate

Upgrade pip (optional)

pip install --upgrade pip

Check out

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]

Configure

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

Initialize database

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).

Load sample data to DB (optional)

(Optional) Load sample data to the dababase.

flask import-csv acondbs/tests/sample/csv/

Run

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

Access to the server with cURL

Now, you can send GraphQL requests to the server, for example, as follows.

curl -d "query={allMaps { edges { node { name mapper } } }}" localhost:5000/graphql

Access to the server with a web browser

If you access to the server with a web browser, it will show a graphical user interface GraphiQL: http://localhost:5000/graphql

Unit test

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.

Metadata

Release files for acondbs 0.4.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acondbs 0.4.8
File Size Uploaded Provenance
acondbs-0.4.8.tar.gz 40.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for acondbs 0.4.8
File Interpreter ABI Platform
acondbs-0.4.8-py3-none-any.whl Python 3 none any Details

Total release size: 108.8 kB

Release files / acondbs-0.4.8.tar.gz

Download URL acondbs-0.4.8.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
82a5ce90d01b02e391c03ca273b56d5e057fe309944abeba9b4e7dd7b8098e21
BLAKE2b-256 checksum
How to use checksums
252509b4815a7fe68edf8079f0574c9f077f91ae4dc7fe3392b2a05db708316c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / acondbs-0.4.8-py3-none-any.whl

Download URL acondbs-0.4.8-py3-none-any.whl
Size 68.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a0356593a2ad7ba9ff0671752f7f112245913b42e93873c06a6412ba20a6daf
BLAKE2b-256 checksum
How to use checksums
5982a160cf5d7e93f2264cc6ea599b5e6e917119145033db75853db732085d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Security for acondbs 0.4.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page