# OPTIMADE API implementation for AiiDA
The compatibility matrix below assumes the user always install the latest patch release of the specified minor version, which is recommended.
| Plugin | AiiDA | Python | Specification |
|-|-|-|-|
| `v1.0 < v2.0` | ![Compatibility for v1.0][AiiDA v2 range] | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-optimade)](https://pypi.org/project/aiida-optimade) | ![OPTIMADE API compatibility][OPTIMADE from OPT] |
| `v0.18 <= v0.20` | ![Compatibility for v0][AiiDA v1 range] | [![PyPI pyversions][Python v3.7-v3.9]](https://pypi.org/project/aiida-optimade/0.20.0/) | ![OPTIMADE API compatibility][OPTIMADE from OPT] |
| Latest release | Build status | Activity |
|:--------------:|:------------:|:--------:|
| [![AiiDA](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/aiidateam/aiida-optimade/develop/.ci/aiida-version.json)](https://github.com/aiidateam/aiida-core/)<br>[![PyPI](https://img.shields.io/pypi/v/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![OPTIMADE](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/v0.24.1/optimade-version.json)](https://github.com/Materials-Consortia/OPTIMADE/) | [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/aiidateam/aiida-optimade/aiida-optimade)](https://github.com/aiidateam/aiida-optimade/actions/)<br>[![Codecov](https://img.shields.io/codecov/c/gh/aiidateam/aiida-optimade)](https://codecov.io/gh/aiidateam/aiida-optimade) | [![GitHub last commit](https://img.shields.io/github/last-commit/aiidateam/aiida-optimade)](https://github.com/aiidateam/aiida-optimade) |
This is a RESTful API server created with [FastAPI](https://fastapi.tiangolo.com/) that exposes an AiiDA database according to the [OPTIMADE specification](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst).
It is mainly used by [Materials Cloud](https://www.materialscloud.org/) 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`](https://github.com/Materials-Consortia/optimade-python-tools) package.
Indeed, the filter grammar and parser and [`pydantic`](https://pydantic-docs.helpmanual.io/) models from [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools) are used directly here.
## 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
The package is relased on PyPI, hence you can install it by:
```shell
$ pip install aiida-optimade
```
Otherwise, you can also `git clone` the repository from GitHub:
```shell
$ git clone https://github.com/aiidateam/aiida-optimade /path/to/aiida-optimade/parent/dir
$ pip install -e /path/to/aiida-optimade
```
### Development
For developers, there is a special setuptools extra `dev`, which can be installed by:
```shell
$ pip install aiida-optimade[dev]
```
or
```shell
$ pip install -e /path/to/aiida-optimade[dev]
```
This package uses [Black](https://black.readthedocs.io/en/stable/) for formatting.
If you wish to contribute, please install the git pre-commit hook:
```shell
/path/to/aiida-optimade$ pre-commit install
```
This will automatically update the formatting when running `git commit`, as well as check the validity of various repository JSON and YAML files.
For testing run `pytest`, which will run with an AiiDA backend as standard.
The tests can also be run with the MongoDB backend by setting the environment variable `PYTEST_OPTIMADE_CONFIG_FILE`, the value being a path to the config file to be used:
```shell
$ PYTEST_OPTIMADE_CONFIG_FILE=/path/to/aiida-optimade/tests/static/test_mongo_config.json pytest
```
However, note that the `mongo_uri` value will have to be updated according to your local setup.
## Initialization
You should first initialize your AiiDA profile.
This can be done by using the `aiida-optimade` CLI:
```shell
$ aiida-optimade -p <PROFILE> init
```
Where `<PROFILE>` is the AiiDA profile.
> **Note**: Currently, the default is `optimade`, if the `-p / --profile` option is not specified.
> This will be changed in the future to use the default AiiDA profile.
Initialization goes through your profile's `StructureData` nodes, adding an `optimade` extra, wherein all OPTIMADE-specific fields that do not have an equivalent AiiDA property are stored.
If in the future, more `StructureData` nodes are added to your profile's database, these will be automatically updated for the first query, filtering on any of these OPTIMADE-specific fields.
However, if you do not wish a significant lag for the user or risking several GET requests coming in at the same time, trying to update your profile's database, you should re-run `aiida-optimade init` for your profile (in between shutting the server down and restarting it again).
## Running the server
### Locally
Using the `aiida-optimade` CLI, you can do the following:
```shell
$ aiida-optimade -p <PROFILE> run
```
Where `<PROFILE>` is the AiiDA profile you wish to serve.
> **Note**: Currently, the default is `optimade`, if the `-p / --profile` option is now specified.
> This will be changed in the future to use the default AiiDA profile.
You also have the opportunity to specify the AiiDA profile via the environment variable `AIIDA_PROFILE`.
Note, however, that if a profile name is passed to the CLI, it will overrule _and replace_ the current `AIIDA_PROFILE` environment variable.
```shell
# Specifying AiiDA profile as an environment variable
$ export AIIDA_PROFILE=optimade
$ aiida-optimade run
```
Navigate to `http://localhost:5000/v1/info`
> **Tip**: To see the default AiiDA profile, type `verdi profile list` to find the colored profile name marked with an asterisk (`*`), or type `verdi profile show`, which will show you more detailed information about the default profile.
> **Note**: The `aiida-optimade run` command has more options to configure your server, run
>
> ```shell
> $ aiida-optimade run --help
> ```
>
> for more information.
### With Docker
Adapt `profiles/test_psql_dos.json` and `profiles/docker-compose.yml` appropriately.
```shell
$ docker-compose -f profiles/docker-compose.yml up --build
```
Navigate to `http://localhost:3253/v1/info`
Stop by using
```shell
$ docker-compose -f profiles/docker-compose.yml down
```
#### Jinja templates
If you are familiar with [Jinja](https://palletsprojects.com/p/jinja/), there are two templates to create the JSON and YAML files: `profiles/config.j2` and `profiles/docker-compose.j2`, respectively.
## Configure the server
You can configure the server with the `aiida_optimade/config.json` file or set certain environment variables.
To learn more about this, see the [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools) repository.
### Using AiiDA group for curated data
An [AiiDA Group](https://aiida.readthedocs.io/projects/aiida-core/en/latest/howto/data.html#organizing-data) can be used to curate data and serve only this curated data through the OPTIMADE server.
Setting the `query_group` option in `config.json` will ensure only the valid (`StructureData`, `CifData`) data nodes in the given AiiDA Group will be served.
Set the `query_group` parameter to `null` (default) to serve all structure data from the database.
## 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.
## For maintainers
To release the new version, go to GitHub release API of the repo create a new release and update the release information.
The release action will be triggered by newly created release.
Note, the tag should start with a `v` and be followed by a full semantic version (see [SemVer](https://semver.org)).
For example: `v2.3.12`.
[AiiDA v2 range]: https://img.shields.io/badge/AiiDA->=2.0.0,<3.0.0-007ec6.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAhCAYAAABTERJSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAFhgAABYYBG6Yz4AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUbSURBVFiFzZhrbFRVEMd%2Fc%2B5uu6UUbIFC%2FUAUVEQCLbQJBIiBDyiImJiIhmohYNCkqJAQxASLF8tDgYRHBLXRhIcKNtFEhVDgAxBJqgmVh4JEKg3EIn2QYqBlt917xg%2BFss%2ByaDHOtzsz5z%2B%2FuZl7ztmF%2F5HJvxVQN6cPYX8%2FPLnOmsvNAvqfwuib%2FbNIk9cQeQnLcKRL5xLIV%2Fic9eJeunjPYbRs4FjQSpTB3aS1IpRKeeOOewajy%2FKKEO8Q0DuVdKy8IqsbPulxGHUfCBBu%2BwUYGuFuBTK7wQnht6PEbf4tlRomVRjCbXNjQEB0AyrFQOL5ENIJm7dTLZE6DPJCnEtFZVXDLny%2B4Sjv0PmmYu1ZdUek9RiMgoDmJ8V0L7XJqsZ3UW8YsBOwEeHeeFce7jEYXBy0m9m4BbXqSj2%2Bxnkg26MCVrN6DEZcwggtd8pTFx%2Fh3B9B50YLaFOPwXQKUt0tBLegtSomfBlfY13PwijbEnhztGzgJsK5h9W9qeWwBqjvyhB2iBs1Qz0AU974DciRGO8CVN8AJhAeMAdA3KbrKEtvxhsI%2B9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4%2FIfQzNMjaE9WwpYOWQnOdEF%2BTdJNO0iFh7%2BI0kfORzQZb6P2kymS9oTxzBiM9rUqLWr1WE5G6ODhycQd%2FUnNVeMbcH68hYkGycNoUNWc8fxaxfwhDbHpfwM5oeTY7rUX8QAAAABJRU5ErkJggg%3D%3D
[Python v3.7-v3.9]: https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9-blue
[OPTIMADE from OPT]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/v0.24.1/optimade-version.json
Raw data
{
"_id": null,
"home_page": "https://github.com/aiidateam/aiida-optimade",
"name": "aiida-optimade",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "optimade aiida materials",
"author": "Casper Welzel Andersen",
"author_email": "developers@aiida.net",
"download_url": "https://files.pythonhosted.org/packages/11/ef/3bfee97f511e3e9640ca6e89bd6d60630832e0a5c2d77c2773ada27979be/aiida-optimade-1.1.1.tar.gz",
"platform": null,
"description": "# OPTIMADE API implementation for AiiDA\n\nThe compatibility matrix below assumes the user always install the latest patch release of the specified minor version, which is recommended.\n\n| Plugin | AiiDA | Python | Specification |\n|-|-|-|-|\n| `v1.0 < v2.0` | ![Compatibility for v1.0][AiiDA v2 range] | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-optimade)](https://pypi.org/project/aiida-optimade) | ![OPTIMADE API compatibility][OPTIMADE from OPT] |\n| `v0.18 <= v0.20` | ![Compatibility for v0][AiiDA v1 range] | [![PyPI pyversions][Python v3.7-v3.9]](https://pypi.org/project/aiida-optimade/0.20.0/) | ![OPTIMADE API compatibility][OPTIMADE from OPT] |\n\n| Latest release | Build status | Activity |\n|:--------------:|:------------:|:--------:|\n| [![AiiDA](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/aiidateam/aiida-optimade/develop/.ci/aiida-version.json)](https://github.com/aiidateam/aiida-core/)<br>[![PyPI](https://img.shields.io/pypi/v/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![OPTIMADE](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/v0.24.1/optimade-version.json)](https://github.com/Materials-Consortia/OPTIMADE/) | [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/aiidateam/aiida-optimade/aiida-optimade)](https://github.com/aiidateam/aiida-optimade/actions/)<br>[![Codecov](https://img.shields.io/codecov/c/gh/aiidateam/aiida-optimade)](https://codecov.io/gh/aiidateam/aiida-optimade) | [![GitHub last commit](https://img.shields.io/github/last-commit/aiidateam/aiida-optimade)](https://github.com/aiidateam/aiida-optimade) |\n\nThis is a RESTful API server created with [FastAPI](https://fastapi.tiangolo.com/) that exposes an AiiDA database according to the [OPTIMADE specification](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst).\n\nIt is mainly used by [Materials Cloud](https://www.materialscloud.org/) to expose access to archived AiiDA databases through the OPTIMADE API.\nBut it may be freely implemented by any to fulfill a similar purpose.\n\nThe server is based on the test server \"template\" used in the [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools) package.\nIndeed, the filter grammar and parser and [`pydantic`](https://pydantic-docs.helpmanual.io/) models from [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools) are used directly here.\n\n## Prerequisites\n\nEnvironment where AiiDA is installed. \nAiiDA database containing `StructureData` nodes, since these are the _only_ AiiDA nodes that are currently exposed with this API (under the `/structures` endpoint).\n\n## Installation\n\nThe package is relased on PyPI, hence you can install it by:\n\n```shell\n$ pip install aiida-optimade\n```\n\nOtherwise, you can also `git clone` the repository from GitHub:\n\n```shell\n$ git clone https://github.com/aiidateam/aiida-optimade /path/to/aiida-optimade/parent/dir\n$ pip install -e /path/to/aiida-optimade\n```\n\n### Development\n\nFor developers, there is a special setuptools extra `dev`, which can be installed by:\n\n```shell\n$ pip install aiida-optimade[dev]\n```\n\nor\n\n```shell\n$ pip install -e /path/to/aiida-optimade[dev]\n```\n\nThis package uses [Black](https://black.readthedocs.io/en/stable/) for formatting.\nIf you wish to contribute, please install the git pre-commit hook:\n\n```shell\n/path/to/aiida-optimade$ pre-commit install\n```\n\nThis will automatically update the formatting when running `git commit`, as well as check the validity of various repository JSON and YAML files.\n\nFor testing run `pytest`, which will run with an AiiDA backend as standard.\nThe tests can also be run with the MongoDB backend by setting the environment variable `PYTEST_OPTIMADE_CONFIG_FILE`, the value being a path to the config file to be used:\n\n```shell\n$ PYTEST_OPTIMADE_CONFIG_FILE=/path/to/aiida-optimade/tests/static/test_mongo_config.json pytest\n```\n\nHowever, note that the `mongo_uri` value will have to be updated according to your local setup.\n\n## Initialization\n\nYou should first initialize your AiiDA profile.\n\nThis can be done by using the `aiida-optimade` CLI:\n\n```shell\n$ aiida-optimade -p <PROFILE> init\n```\n\nWhere `<PROFILE>` is the AiiDA profile.\n\n> **Note**: Currently, the default is `optimade`, if the `-p / --profile` option is not specified.\n> This will be changed in the future to use the default AiiDA profile.\n\nInitialization goes through your profile's `StructureData` nodes, adding an `optimade` extra, wherein all OPTIMADE-specific fields that do not have an equivalent AiiDA property are stored.\n\nIf in the future, more `StructureData` nodes are added to your profile's database, these will be automatically updated for the first query, filtering on any of these OPTIMADE-specific fields.\nHowever, if you do not wish a significant lag for the user or risking several GET requests coming in at the same time, trying to update your profile's database, you should re-run `aiida-optimade init` for your profile (in between shutting the server down and restarting it again).\n\n## Running the server\n\n### Locally\n\nUsing the `aiida-optimade` CLI, you can do the following:\n\n```shell\n$ aiida-optimade -p <PROFILE> run\n```\n\nWhere `<PROFILE>` is the AiiDA profile you wish to serve.\n\n> **Note**: Currently, the default is `optimade`, if the `-p / --profile` option is now specified.\n> This will be changed in the future to use the default AiiDA profile.\n\nYou also have the opportunity to specify the AiiDA profile via the environment variable `AIIDA_PROFILE`.\nNote, however, that if a profile name is passed to the CLI, it will overrule _and replace_ the current `AIIDA_PROFILE` environment variable.\n\n```shell\n# Specifying AiiDA profile as an environment variable\n$ export AIIDA_PROFILE=optimade\n$ aiida-optimade run\n```\n\nNavigate to `http://localhost:5000/v1/info`\n\n> **Tip**: To see the default AiiDA profile, type `verdi profile list` to find the colored profile name marked with an asterisk (`*`), or type `verdi profile show`, which will show you more detailed information about the default profile.\n\n> **Note**: The `aiida-optimade run` command has more options to configure your server, run\n>\n> ```shell\n> $ aiida-optimade run --help\n> ```\n>\n> for more information.\n\n### With Docker\n\nAdapt `profiles/test_psql_dos.json` and `profiles/docker-compose.yml` appropriately.\n\n```shell\n$ docker-compose -f profiles/docker-compose.yml up --build\n```\n\nNavigate to `http://localhost:3253/v1/info`\n\nStop by using\n\n```shell\n$ docker-compose -f profiles/docker-compose.yml down\n```\n\n#### Jinja templates\n\nIf you are familiar with [Jinja](https://palletsprojects.com/p/jinja/), there are two templates to create the JSON and YAML files: `profiles/config.j2` and `profiles/docker-compose.j2`, respectively.\n\n## Configure the server\n\nYou can configure the server with the `aiida_optimade/config.json` file or set certain environment variables.\n\nTo learn more about this, see the [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools) repository.\n\n### Using AiiDA group for curated data\n\nAn [AiiDA Group](https://aiida.readthedocs.io/projects/aiida-core/en/latest/howto/data.html#organizing-data) can be used to curate data and serve only this curated data through the OPTIMADE server.\nSetting the `query_group` option in `config.json` will ensure only the valid (`StructureData`, `CifData`) data nodes in the given AiiDA Group will be served.\nSet the `query_group` parameter to `null` (default) to serve all structure data from the database.\n\n## Design choices\n\n**Q: Why create an individual `config.json` file instead of just mounting an existing `.aiida` directory and using that directly?** \n**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.\n\n## For maintainers\n\nTo release the new version, go to GitHub release API of the repo create a new release and update the release information. \nThe release action will be triggered by newly created release.\nNote, the tag should start with a `v` and be followed by a full semantic version (see [SemVer](https://semver.org)).\nFor example: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OPT]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/v0.24.1/optimade-version.json\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Expose an AiiDA database according to the [OPTIMADE API specification](https://www.optimade.org).",
"version": "1.1.1",
"project_urls": {
"Homepage": "https://github.com/aiidateam/aiida-optimade"
},
"split_keywords": [
"optimade",
"aiida",
"materials"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "11ef3bfee97f511e3e9640ca6e89bd6d60630832e0a5c2d77c2773ada27979be",
"md5": "e92ddfc0f97e61096092c9f7b49e4b32",
"sha256": "983498b56480c258c9961d8fa06bebaad502b3a1e4384f1a46381ed9dab0b21b"
},
"downloads": -1,
"filename": "aiida-optimade-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "e92ddfc0f97e61096092c9f7b49e4b32",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 45979,
"upload_time": "2023-06-09T16:41:35",
"upload_time_iso_8601": "2023-06-09T16:41:35.851175Z",
"url": "https://files.pythonhosted.org/packages/11/ef/3bfee97f511e3e9640ca6e89bd6d60630832e0a5c2d77c2773ada27979be/aiida-optimade-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-09 16:41:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aiidateam",
"github_project": "aiida-optimade",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "aiida-optimade"
}