← 返回首页
GitHub - datalab-industries/icsd-optimade: Prototyping an OPTIMADE API for the Inorganic Crystal Structure Database (ICSD) · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

datalab-industries/icsd-optimade

Go to file
Code

Repository files navigation

ICSD OPTIMADE API

This repo contains prototyping work for creating an OPTIMADE API for searching and accessing structures from the Inorganic Crystal Structure Database (ICSD).

The structures are accessed via the ICSD REST API and cast to the OPTIMADE format; the optimade-maker and optimade-python-tools are then used to launch a local OPTIMADE API.

Installation

After cloning this repository and using some appropriate method of creating a virtual environment (current recommendation is uv), this package can be installed with

git clone git@github.com:datalab-industries/icsd-optimade cd icsd-optimade uv sync

or

git clone git@github.com:datalab-industries/icsd-optimade cd icsd-optimade pip install .

Important

Any attempts to use ICSD data will additionally require a valid ICSD license with login details provided at runtime.

Usage

Ingesting ICSD data

The CSD can be ingested into the OPTIMADE format using the icsd-ingest entrypoint:

icsd-ingest

This will use multiple processes (controlled by --num-processes) to ingest the local copy of the CSD database in chunks of size --chunk-size until the target --num-structures has been reached (defaults to the entire CSD). Each batch will be written to an OPTIMADE JSONLines file, and combined into a single JSONLines file on completion, with name <--run-name>-optimade.jsonl.

Creating an OPTIMADE API

The icsd-serve entrypoint provides a thin wrapper around the optimade-maker tool, and bundles the simple configuration required to launch a local OPTIMADE API with a simple in-memory database (if --mongo-uri is provided, a real MongoDB backend will be used). Just provide the path to your combined OPTIMADE JSONLines file:

icsd-serve <path-to-optimade-jsonl>

You should now be able to try out some queries locally, either in the browser or with a tool like curl:

curl http://localhost:5000/structures?filter=elements HAS "C"

Containerized version

For ease of deployment, as containerised version of the ingestion pipeline is available.

Important

You should verify that your license agreement allows for any kind of deployment outside of your private network; it likely does not.

docker build --secret id=env,src=.env -t icsd-optimade .

For development, you may prefer to use the bake definitions in docker-bake.hcl to build and tag the relevant build stages.

Contributing and Getting Help

All development of this package (bug reports, suggestions, feedback and pull requests) occurs in the csd-optimade GitHub repository. Contribution guidelines and tips for getting help can be found in the contributing notes.

Funding

This project was developed by datalab industries ltd., on behalf of the UK's Physical Sciences Data Infrastructure (PSDI).

About

Prototyping an OPTIMADE API for the Inorganic Crystal Structure Database (ICSD)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Footer

© 2026 GitHub, Inc.