Skip to main content

optimade-maker

PyPI - Version PyPI - License GitHub Actions Workflow Status DOI Paper DOI

Tools for making OPTIMADE APIs from various formats of structural data (e.g. an archive of CIF files).

This repository contains the src/optimade-maker Python package and the corresponding CLI tool optimake, which together provide this functionality. Features include

  • definition of a config file format (optimade.yaml) for annotating data archives to be used in the OPTIMADE ecosystem;
  • conversion of the raw data into corresponding OPTIMADE types using pre-existing parsers (e.g., ASE for structures);
  • conversion of the annotated data archive into the OPTIMADE JSON Lines file format (spec) that can be ingested into a database and used to serve a full OPTIMADE API.
  • serving either an annotated data archive or a JSON Lines file as an OPTIMADE API (using the optimade-python-tools reference server implementation).

Installation and usage

Install with

pip install optimade-maker
# or to get all ingestion plugins (e.g. pymatgen, aiida):
pip install optimade-maker[ingest]

this will also make the optimake CLI utility available.

For a folder containing the data archive and the optimade.yaml file (such as in /examples), run

  • optimake convert . to convert the entry into the JSONL format (see below).
  • optimake serve . to start the OPTIMADE API (this also converts the entry, if needed);

For more detailed information, see optimake --help.

Tutorial

The sections below provide a high-level overview of the functionality, but a step-by-step notebook tutorial is available in examples/00_tutorial/tutorial.ipynb, demonstrating the full workflow from raw data to a running OPTIMADE API and example queries.

To run the tutorial locally, install optimade-maker[tutorial] and open the notebook with Jupyter.

Annotating with optimade.yaml

To annotate your structural data for optimade-maker, the data archive needs to be accompanied by an optimade.yaml config file. The following is a simple example for a ZIP archive (structures.zip) of CIF files together with an optional property file (properties.csv):

config_version: 0.2.0
database_description: Simple DB

entries:
  - entry_type: structures
    entry_paths:
      - path: structures.zip
        matches:
          - cifs/*/*.cif
    # (optional) properties:
    property_paths:
      - path: properties.csv
    property_definitions:
      - name: energy
        title: Total energy
        description: DFT total energy
        unit: eV/atom
        type: float

See ./examples for a more complete set of supported formats and corresponding optimade.yaml config files.

Structure ids and property files

optimade-maker will assign an id for each structure based on its full path in the archive, following a simple deterministic rule: from the set of all archive paths, the maximum common path prefix and postfix (including file extensions) are removed. E.g.

structures.zip/cifs/set1/101.cif
structures.zip/cifs/set2/102.cif

produces ["set1/101", "set2/102"].

The property files need to either refer to these ids or the full path in the archive to be associated with a structure. E.g. a possible property csv file could be

id,energy
set1/101,2.5
structures.zip/cifs/set2/102.cif,3.2

Usage in a custom data pipeline

The toolkit supports a custom data pipeline (e.g. with an external MongoDB), by allowing to override any of the configuration passed to optimade-python-tools. See ./examples/override_config for details.

Relevant links

Citation

If you use optimade-maker in your research, please cite:

K. Eimre, M. L. Evans, B. Macaulay, X. Wang, J. Yu, N. Marzari, G.-M. Rignanese, and G. Pizzi, optimade-maker: Automated generation of interoperable materials APIs from static datasets, Digital Discovery (2026). DOI: 10.1039/D6DD00125D

Preprint: https://doi.org/10.48550/arXiv.2603.23536

For developers

Releasing a new version

This project uses setuptools_scm, which reads the version from git tags. To release a new version:

git checkout main
git pull
git tag -a vX.Y.Z -m "Release X.Y.Z"
git push --tags

This will trigger the Github Action that will create 1) a Github release; and 2) build and publish the package on pypi.

Acknowledgements

This project was funded by the NCCR MARVEL, a National Centre of Competence in Research, funded by the Swiss National Science Foundation (grant number 205602). We also acknowledge support by the Open Research Data Program of the Swiss ETH Board (project "API-03 IntER").

Metadata

Release files for optimade-maker 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optimade-maker 1.0.0
File Size Uploaded
optimade_maker-1.0.0.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for optimade-maker 1.0.0
File Interpreter ABI Platform
optimade_maker-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / optimade_maker-1.0.0.tar.gz

Download URL optimade_maker-1.0.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
72301015d5a76addb94274715808df9c4ec48142cee91c5d9076462edee1493a
BLAKE2b-256 checksum
How to use checksums
6ed999e53f43a9afc9fbc1203b096e1a0f3dbe4d86b4a191bfff74a588de0fe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / optimade_maker-1.0.0-py3-none-any.whl

Download URL optimade_maker-1.0.0-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d21c3845a7650d451e02452968e14c8472b6ed4ba2e5252a4b92a86f4a2c604
BLAKE2b-256 checksum
How to use checksums
fa362c5dbc493bb76482d9254fa1238b40a21f007df9343c9939f9851a02ff82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page