Skip to main content

Tools for implementing and consuming OPTiMaDe APIs.

Project description

Build Status

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")

example tree

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

optimade-0.1.12.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

optimade-0.1.12-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

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

Hashes for optimade-0.1.12.tar.gz
Algorithm Hash digest
SHA256 b2d09278457792c4e3b59109f3d4b6aaff38072d0303d6b4d3d7c1392828fca5
MD5 eda2c34ebaef2d0f2f5b411ad86f8340
BLAKE2b-256 896b3e3d9caea7ceeb75f48826f6b4b813e3c31a74ad1b0df26e755197908625

See more details on using hashes here.

File details

Details for the file optimade-0.1.12-py3-none-any.whl.

File metadata

File hashes

Hashes for optimade-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4f21de924357a5efedfb28e70714dd483591923c910596b1cc3861188e6ebbfc
MD5 9fd0ee0335e29f8aeb0f7af2a2843155
BLAKE2b-256 25e3aa8d477d0d7264bdbbe7e244a72e4461d0f15be92fd696f438390f9af99f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page