Skip to main content

Expose an AiiDA database according to the OPTiMaDe specification.

Project description

Optimade API implementation for AiiDA

This is a RESTful API server created with FastAPI that exposes an AiiDA database according to the OPTiMaDe specification.

The server is based on the test server "template" used in the optimade-python-tools package. Indeed, the filter grammar and parser and pydantic models from optimade-python-tools are used directly here.

Lastly, the server utilizes the FastAPI concept of routers, which means each endpoint can be "setup" several times, allowing multiple base URLs and more flexibility.

Prerequisites

Environment where AiiDA is installed.
AiiDA database containing StructureData nodes, since these are the only AiiDA nodes that are currently exposed with this API (under the /structures endpoint).

Note: At the moment, aiida-optimade works most optimally with an AiiDA database using the SQLAlchemy backend.

Installation

git clone https://github.com/Materials-Consortia/optimade-python-tools
pip install -e optimade-python-tools/
git clone https://github.com/aiidateam/aiida-optimade
pip install -e aiida-optimade/

Running the server locally

# specify AiiDA profile (will use default otherwise)
export AIIDA_PROFILE=optimade
sh run.sh

Navigate to http://127.0.0.1:5000/optimade/info

Running via docker

Adapt profiles/quicksetup.json and profiles/docker-compose.yml appropriately.

docker-compose -f profiles/docker-compose.yml up --build

Navigate to http://127.0.0.1:3253/optimade/info

Stop by using

docker-compose -f profiles/docker-compose.yml down

Design choices

Q: Why create an individual config.json file instead of just mounting an existing .aiida directory and using that directly?
A: This, currently, wouldn't work because the REPOSITORY_URI needs to point to the right path inside the container, not on the host. Furthermore, storing all configurations in the same file can be fragile.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiida-optimade-0.2.0.tar.gz (27.2 kB view details)

Uploaded Source

File details

Details for the file aiida-optimade-0.2.0.tar.gz.

File metadata

  • Download URL: aiida-optimade-0.2.0.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for aiida-optimade-0.2.0.tar.gz
Algorithm Hash digest
SHA256 392c933eddb20ec7038f13083acbf2cd75e98808479ab8974baa167af00955c4
MD5 1ef1da9fd44f3c81c88f085eab2dcf20
BLAKE2b-256 23515cd581f27f540e5056087d9707961e38fde5a080a245c878614bf15be06c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page