| Latest release | Build status | Activity |
|---|---|---|
The aim of OPTiMaDe is to develop a common API, compliant with the JSON API 1.0 specification. This is to enable interoperability among databases that contain calculated properties of existing and hypothetical materials.
This repository contains a library of tools for implementing and consuming OPTiMaDe APIs using Python.
Both the OPTiMaDe specification and this repository are under development.
This package may be used to setup and run an OPTiMaDe index meta-database.
Install the package via pip install optimade[server] and change the file server.cfg found in the root of the package.
The server.cfg file serves paths to a server runtime configuration file (either an ini or json file, see the config.ini file for an example) and an index /links-endpoint data file.
The paths must be relative from your current working directory, where your server.cfg is located, or they must be absolute paths.
The index meta-database is set up to populate a mongomock in-memory database with resources from a static json file containing the child resources you, as a database provider, want to serve under this index meta-database.
Running the index meta-database is then as simple as writing ./run.sh index in a terminal from the root of this package.
You can find it at the base URL: http://localhost:5001/index/optimade/.
Note: server.cfg is loaded from the current working directory, from where you run run.sh.
E.g., if you have installed optimade on a Linux machine at /home/USERNAME/optimade/optimade-python-tools and you run the following:
:~$ ./optimade/optimade-python-tools/run.sh indexThen you need server.cfg to be located in your home folder containing either relative paths from its current location or absolute paths.
Full installation instructions and contribution guidelines can be found in CONTRIBUTING.
- OPTiMaDe Specification, the human-readable specification that this library is based on.
- OpenAPI, the machine-readable format used to specify the OPTiMaDe API in
openapi.json. - Interactive documentation generated from
openapi.json(see also interactive JSON editor). - pydantic, the library used for generating the OpenAPI schema from Python models.
- FastAPI, the framework used for generating the reference implementation from the
openapi.jsonspecification. - lark, the library used to parse the filter language in OPTiMaDe queries.