Tools for implementing and consuming OPTiMaDe APIs.
Project description
A library of tools for implementing and consuming OPTiMaDe APIs in Python.
The aim of OPTiMaDe is to develop a common API, compliant with the JSON API 1.0 spec, to enable interoperability among databases that contain calculated properties of existing and hypothetical materials.
Status
This library is under development. Progress is expected during the CECAM Workshop on Open Databases Integration for Materials Design during the week of June 11, 2018 to June 15, 2018.
Getting Started
Install via pip install optimade
. Example use:
from optimade.filter import Parser
p = Parser(version=(0, 9, 5))
p.parse("filter=a<3")
Tree(start, [Token(KEYWORD, 'filter='), Tree(expression, [Tree(term, [Tree(atom, [Tree(comparison, [Token(VALUE, 'a'), Token(OPERATOR, '<'), Token(VALUE, '3')])])])])])
p = Parser()
p.version
(0, 9, 5)
tree = p.parse('filter=_mp_bandgap > 5.0 AND _cod_molecular_weight < 350')
print(p)
start
filter=
expression
term
term
atom
comparison
_mp_bandgap
>
5.0
AND
atom
comparison
_cod_molecular_weight
<
350
# Assumes graphviz installed on system and `pip install pydot`
from lark.tree import pydot__tree_to_png
pydot__tree_to_png(tree, "exampletree.png")
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
Built Distribution
File details
Details for the file optimade-0.1.12.tar.gz
.
File metadata
- Download URL: optimade-0.1.12.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2d09278457792c4e3b59109f3d4b6aaff38072d0303d6b4d3d7c1392828fca5 |
|
MD5 | eda2c34ebaef2d0f2f5b411ad86f8340 |
|
BLAKE2b-256 | 896b3e3d9caea7ceeb75f48826f6b4b813e3c31a74ad1b0df26e755197908625 |
File details
Details for the file optimade-0.1.12-py3-none-any.whl
.
File metadata
- Download URL: optimade-0.1.12-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f21de924357a5efedfb28e70714dd483591923c910596b1cc3861188e6ebbfc |
|
MD5 | 9fd0ee0335e29f8aeb0f7af2a2843155 |
|
BLAKE2b-256 | 25e3aa8d477d0d7264bdbbe7e244a72e4461d0f15be92fd696f438390f9af99f |