Skip to content

aiidateam/aiida-restapi

Repository files navigation

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

  • /users (GET/POST) and /users/<id> (GET) endpoints
  • Authentication via JSON web tokens (see test_auth.py for the flow; also works via interactive docs)
  • User pydantic model for validation
  • Automatic documentation at http://127.0.0.1:8000/docs
  • Full specification at http://127.0.0.1:8000/openapi.json

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
pip install -e .[pre-commit,testing]  # install extra dependencies
pre-commit install  # install pre-commit hooks
pytest -v  # discover and run all tests

See the developer guide for more information.

License

MIT

Contact

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