aiidateam / aiida-restapi

AiiDA Web API for data queries and workflow management.
https://aiida-restapi.readthedocs.io
MIT License
9 stars 7 forks source link
graphql rest-api server

Build Status Coverage Status Docs status PyPI version

aiida-restapi

AiiDA REST API for data queries and workflow management.

Uses pydantic for models/validation and fastapi for the ASGI application. Serve e.g. using uvicorn.

Features

Installation

pip install aiida-restapi[auth]

Usage

# start rest api
uvicorn aiida_restapi:app

# start rest api and reload for changes (for development)
uvicorn aiida_restapi:app --reload

Examples

See the examples directory.

Development

git clone https://github.com/aiidateam/aiida-restapi .
cd aiida-restapi

Setting up pre-commit

We use pre-commit to take care for the formatting, type checking and linting.

pip install -e .[pre-commit]  # install extra dependencies
pre-commit run # running pre-commit on changes
pre-commit run --all-files # running pre-commit on every file
pre-commit run pylint --all-files # run only the linter on every file

One can also set up pre-commit to be run on every commit

pre-commit install
# pre-commit uninstall # to disable it again

Running tests

With tox the tests can be run

pip install tox
tox -e py311 # run all tests for Python 3.11
tox -av # see all supported environments

tox will creat a custom environment to run the tests in. If you want to run the tests inside your current environment

pip install -e .[testing]  # install extra dependencies
pytest -v

See the developer guide for more information.

License

MIT

Contact

leopold.talirz@gmail.com chrisj_sewell@hotmail.com