blokhin / optimade-python-tools

Tools for implementing and consuming OPTiMaDe APIs in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OPTiMaDe Python tools

Latest release Build status Activity
PyPI Version
PyPI - Python Version
OPTiMaDe
Build Status
codecov
Heroku
Commit 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.

Status

Both the OPTiMaDe specification and this repository are under development.

Installation (Index Meta-Database)

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 index

Then you need server.cfg to be located in your home folder containing either relative paths from its current location or absolute paths.

Development installation & Contributing

Full installation instructions and contribution guidelines can be found in CONTRIBUTING.

Links

About

Tools for implementing and consuming OPTiMaDe APIs in Python

License:MIT License


Languages

Language:Python 99.5%Language:Shell 0.5%