Expose an AiiDA database according to the [OPTIMADE API specification](https://www.optimade.org).
Project description
Optimade API implementation for AiiDA
Latest release | Build status | Activity |
---|---|---|
This is a RESTful API server created with FastAPI that exposes an AiiDA database according to the OPTIMADE specification.
It is mainly used by Materials Cloud to expose access to archived AiiDA databases through the OPTIMADE API. But it may be freely implemented by any to fulfill a similar purpose.
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).
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
./aiida-optimade/run.sh
Navigate to http://localhost:5000/v0/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://localhost:3253/v0/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file aiida-optimade-0.7.0.tar.gz
.
File metadata
- Download URL: aiida-optimade-0.7.0.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5d8af9eeec7abb05997235c45b6b9f553f33468bacd27828f2c9c417eb8a2c9 |
|
MD5 | bb36dcee45883db7e50d13028deb7c0d |
|
BLAKE2b-256 | b4144bf3ab4f582323edab758801d8caac897f17a31cbf83b63137ef7fbc6030 |