{"id":18620530,"url":"https://github.com/simonsobs/acondbs","last_synced_at":"2026-03-19T05:24:27.125Z","repository":{"id":57407972,"uuid":"239022783","full_name":"simonsobs/acondbs","owner":"simonsobs","description":"ProductDB back-end API","archived":false,"fork":false,"pushed_at":"2023-06-28T22:08:14.000Z","size":1592,"stargazers_count":0,"open_issues_count":14,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-29T09:00:24.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonsobs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-07T21:07:46.000Z","updated_at":"2023-06-22T15:38:54.000Z","dependencies_parsed_at":"2024-11-07T04:07:01.007Z","dependency_job_id":"46614b2d-9359-4cee-b5c1-13e77ff4e147","html_url":"https://github.com/simonsobs/acondbs","commit_stats":{"total_commits":1353,"total_committers":1,"mean_commits":1353.0,"dds":0.0,"last_synced_commit":"7b4e5ab967ce062fc04509a058ee50647dbc9a89"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Facondbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Facondbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Facondbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Facondbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonsobs","download_url":"https://codeload.github.com/simonsobs/acondbs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239413793,"owners_count":19634308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T04:06:51.294Z","updated_at":"2025-11-03T12:30:21.148Z","avatar_url":"https://github.com/simonsobs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI - Version](https://img.shields.io/pypi/v/acondbs.svg)](https://pypi.org/project/acondbs)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/acondbs.svg)](https://pypi.org/project/acondbs)\n[![Test Status](https://github.com/simonsobs/acondbs/actions/workflows/unit-test.yml/badge.svg)](https://github.com/simonsobs/acondbs/actions/workflows/unit-test.yml)\n[![Test Status](https://github.com/simonsobs/acondbs/actions/workflows/type-check.yml/badge.svg)](https://github.com/simonsobs/acondbs/actions/workflows/type-check.yml)\n[![codecov](https://codecov.io/gh/simonsobs/acondbs/branch/main/graph/badge.svg)](https://codecov.io/gh/simonsobs/acondbs)\n\n# Acondbs\n\nProductDB back-end API\n\n## How to check out and run (for developers)\n\n### Prepare environment\n\nCreate a virtual environment\n\n```bash\npython -m venv venv\n```\n\nEnter the virtual environment\n\n```bash\nsource venv/bin/activate\n```\n\nUpgrade pip (optional)\n\n```bash\npip install --upgrade pip\n```\n\n### Check out\n\nClone the repository from GitHub\n\n```bash\ngit clone git@github.com:simonsobs/acondbs.git\n```\n\nInstall from the clone in the [editable mode](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs).\n\n```bash\npip install -e acondbs/[tests]\n```\n\n### Configure\n\nCreate an instance folder of Flask, where the config file and the SQLite DB file are stored. Check out an example instance folder from GitHub\n\n```bash\ngit clone git@github.com:TaiSakuma/acondbs-instance-example.git instance\n```\n\nSet environmental variables\n\n```bash\nexport FLASK_APP=\"acondbs:create_app('$PWD/instance/config.py')\"\nexport FLASK_DEBUG=1\n```\n\n### Initialize database\n\n```bash\nflask init-db\n```\n\nAn 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).\n\n### Load sample data to DB (optional)\n\n(Optional) Load sample data to the dababase.\n\n```bash\nflask import-csv acondbs/tests/sample/csv/\n```\n\n### Run\n\nRun with the Flask built-in server for the development. (Deployment options for proudction are descriped in the [Flask documentation](https://flask.palletsprojects.com/en/1.1.x/deploying/).)\n\n```bash\nflask run\n```\n\nThe above command starts the built-in server that only allows accress from localhost. It starts the server at the default TCP port, usually `5000`.\n\nTo allow the access from outside, use `--host=0.0.0.0` option. The TCP port can be specified by `--port` option. For example:\n\n```bash\nflask run --host=0.0.0.0 --port=5000\n```\n\n#### Access to the server with cURL\n\nNow, you can send GraphQL requests to the server, for example, as follows.\n\n```bash\ncurl -d \"query={allMaps { edges { node { name mapper } } }}\" localhost:5000/graphql\n```\n\n#### Access to the server with a web browser\n\nIf you access to the server with a web browser, it will show a graphical user interface *GraphiQL*: \u003chttp://localhost:5000/graphql\u003e\n\n### Unit test\n\nMove to the repository\n\n```bash\ncd acondbs\n```\n\nRun the unit tests\n\n```bash\npytest\n```\n\nRun the unit tests with coverage\n\n```bash\npytest --cov\n```\n\nGenerate the coverage report\n\n```bash\ncoverage html\n```\n\nThe report can be found at `coverage_html_report/index.html`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Facondbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonsobs%2Facondbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Facondbs/lists"}