Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for optimade, version 0.1.12
Filename, size File type Python version Upload date Hashes
Filename, size optimade-0.1.12-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size optimade-0.1.12.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page