optimade-maker 0.9.0__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/PKG-INFO +30 -8
  2. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/README.md +27 -7
  3. optimade_maker-1.0.0/examples/00_tutorial/.testing/first_entry.json +1 -0
  4. optimade_maker-1.0.0/examples/00_tutorial/cifs/Ba.cif +33 -0
  5. optimade_maker-1.0.0/examples/00_tutorial/cifs/BaTiO3.cif +37 -0
  6. optimade_maker-1.0.0/examples/00_tutorial/cifs/SrC6.cif +46 -0
  7. optimade_maker-1.0.0/examples/00_tutorial/optimade.yaml +17 -0
  8. optimade_maker-1.0.0/examples/00_tutorial/properties.csv +4 -0
  9. optimade_maker-1.0.0/examples/00_tutorial/tutorial.ipynb +189 -0
  10. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/aiida_archive/optimade.yaml +2 -2
  11. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/bzipped_pymatgen/optimade.yaml +2 -2
  12. optimade_maker-1.0.0/examples/directory_of_cifs/.gitignore +1 -0
  13. optimade_maker-1.0.0/examples/directory_of_cifs/.testing/first_entry.json +1 -0
  14. optimade_maker-1.0.0/examples/directory_of_cifs/cifs/101.cif +46 -0
  15. optimade_maker-1.0.0/examples/directory_of_cifs/cifs/102.cif +34 -0
  16. optimade_maker-1.0.0/examples/directory_of_cifs/optimade.yaml +17 -0
  17. optimade_maker-1.0.0/examples/directory_of_cifs/properties.json +8 -0
  18. optimade_maker-1.0.0/examples/override_config/README.md +23 -0
  19. optimade_maker-1.0.0/examples/override_config/optimade.yaml +32 -0
  20. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/properties/optimade.yaml +4 -4
  21. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/simple_zip_of_cif/optimade.yaml +5 -5
  22. optimade_maker-1.0.0/examples/simple_zip_of_cif/properties.csv +3 -0
  23. optimade_maker-1.0.0/examples/xyz_files_no_compression/.gitignore +1 -0
  24. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/xyz_files_no_compression/optimade.yaml +9 -9
  25. optimade_maker-1.0.0/examples/zip_of_cif/.gitignore +3 -0
  26. optimade_maker-1.0.0/examples/zip_of_cif/.testing/first_entry.json +1 -0
  27. optimade_maker-1.0.0/examples/zip_of_cif/data.tar.gz +0 -0
  28. optimade_maker-1.0.0/examples/zip_of_cif/optimade.yaml +33 -0
  29. optimade_maker-1.0.0/examples/zip_of_cif/structures.zip +0 -0
  30. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/zip_of_cif_and_xyz/optimade.yaml +2 -2
  31. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/pyproject.toml +1 -0
  32. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/config.py +11 -8
  33. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/convert.py +124 -67
  34. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker.egg-info/PKG-INFO +30 -8
  35. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker.egg-info/SOURCES.txt +21 -1
  36. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker.egg-info/requires.txt +3 -0
  37. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/uv.lock +789 -1
  38. optimade_maker-0.9.0/examples/simple_zip_of_cif/properties.csv +0 -3
  39. optimade_maker-0.9.0/examples/zip_of_cif/optimade.yaml +0 -33
  40. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/.github/CODEOWNERS +0 -0
  41. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/.github/dependabot.yml +0 -0
  42. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/.github/workflows/ci.yml +0 -0
  43. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/.github/workflows/release_and_publish.yml +0 -0
  44. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/.gitignore +0 -0
  45. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/.pre-commit-config.yaml +0 -0
  46. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/LICENSE +0 -0
  47. {optimade_maker-0.9.0/examples/aiida_archive → optimade_maker-1.0.0/examples/00_tutorial}/.gitignore +0 -0
  48. {optimade_maker-0.9.0/examples/xyz_files_no_compression → optimade_maker-1.0.0/examples/aiida_archive}/.gitignore +0 -0
  49. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/aiida_archive/.testing/first_entry.json +0 -0
  50. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/aiida_archive/README.md +0 -0
  51. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/aiida_archive/data.csv +0 -0
  52. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/aiida_archive/example.aiida +0 -0
  53. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/bzipped_pymatgen/.gitignore +0 -0
  54. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/bzipped_pymatgen/.testing/first_entry.json +0 -0
  55. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/bzipped_pymatgen/part_1.json.bz2 +0 -0
  56. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/direct_from_jsonl/.testing/first_entry.json +0 -0
  57. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/direct_from_jsonl/optimade.jsonl +0 -0
  58. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/direct_from_jsonl/optimade.yaml +0 -0
  59. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/direct_from_jsonl_gz/.gitignore +0 -0
  60. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/direct_from_jsonl_gz/.testing/first_entry.json +0 -0
  61. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/direct_from_jsonl_gz/example.jsonl.gz +0 -0
  62. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/direct_from_jsonl_gz/optimade.yaml +0 -0
  63. {optimade_maker-0.9.0/examples/zip_of_cif → optimade_maker-1.0.0/examples/override_config}/.gitignore +0 -0
  64. {optimade_maker-0.9.0/examples/zip_of_cif → optimade_maker-1.0.0/examples/override_config}/.testing/first_entry.json +0 -0
  65. {optimade_maker-0.9.0/examples/zip_of_cif → optimade_maker-1.0.0/examples/override_config}/data.tar.gz +0 -0
  66. {optimade_maker-0.9.0/examples/zip_of_cif → optimade_maker-1.0.0/examples/override_config}/override_config.json +0 -0
  67. {optimade_maker-0.9.0/examples/zip_of_cif → optimade_maker-1.0.0/examples/override_config}/structures.zip +0 -0
  68. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/properties/.gitignore +0 -0
  69. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/properties/.testing/first_entry.json +0 -0
  70. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/properties/prop1.csv +0 -0
  71. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/properties/prop2.json +0 -0
  72. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/properties/structures.zip +0 -0
  73. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/simple_zip_of_cif/.gitignore +0 -0
  74. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/simple_zip_of_cif/.testing/first_entry.json +0 -0
  75. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/simple_zip_of_cif/structures.zip +0 -0
  76. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/xyz_files_no_compression/.testing/first_entry.json +0 -0
  77. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/xyz_files_no_compression/C_1.xyz +0 -0
  78. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/xyz_files_no_compression/H_1.xyz +0 -0
  79. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/xyz_files_no_compression/H_2.xyz +0 -0
  80. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/xyz_files_no_compression/data.csv +0 -0
  81. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/zip_of_cif/README.md +0 -0
  82. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/zip_of_cif_and_xyz/.gitignore +0 -0
  83. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/zip_of_cif_and_xyz/.testing/first_entry.json +0 -0
  84. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/examples/zip_of_cif_and_xyz/structures.zip +0 -0
  85. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/setup.cfg +0 -0
  86. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/__init__.py +0 -0
  87. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/aiida_plugin/__init__.py +0 -0
  88. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/aiida_plugin/config.py +0 -0
  89. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/cli.py +0 -0
  90. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/logger.py +0 -0
  91. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/mongo_utils.py +0 -0
  92. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/parsers.py +0 -0
  93. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker/serve.py +0 -0
  94. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker.egg-info/dependency_links.txt +0 -0
  95. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker.egg-info/entry_points.txt +0 -0
  96. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/src/optimade_maker.egg-info/top_level.txt +0 -0
  97. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/tests/test_convert.py +0 -0
  98. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/tests/test_serve.py +0 -0
  99. {optimade_maker-0.9.0 → optimade_maker-1.0.0}/tests/test_yaml.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optimade-maker
3
- Version: 0.9.0
3
+ Version: 1.0.0
4
4
  Summary: Tools for making OPTIMADE APIs from raw structural data.
5
5
  License: MIT
6
6
  Keywords: optimade,jsonapi,materials
@@ -30,6 +30,8 @@ Provides-Extra: aiida
30
30
  Requires-Dist: aiida-core~=2.6; extra == "aiida"
31
31
  Provides-Extra: ingest
32
32
  Requires-Dist: optimade-maker[aiida,pymatgen]; extra == "ingest"
33
+ Provides-Extra: tutorial
34
+ Requires-Dist: jupyterlab; extra == "tutorial"
33
35
  Provides-Extra: tests
34
36
  Requires-Dist: pytest~=8.3; extra == "tests"
35
37
  Requires-Dist: pytest-cov~=6.0; extra == "tests"
@@ -54,6 +56,8 @@ Dynamic: license-file
54
56
  [![PyPI - Version](https://img.shields.io/pypi/v/optimade-maker?color=4CC61E)](https://pypi.org/project/optimade-maker/)
55
57
  ![PyPI - License](https://img.shields.io/pypi/l/optimade-maker?color=blue)
56
58
  ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/materialscloud-org/optimade-maker/ci.yml)
59
+ [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18863676-blue)](https://doi.org/10.5281/zenodo.18863676)
60
+ [![Paper DOI](https://img.shields.io/badge/Paper-10.1039%2FD6DD00125D-blue)](https://doi.org/10.1039/D6DD00125D)
57
61
 
58
62
  </div>
59
63
 
@@ -84,25 +88,31 @@ For a folder containing the data archive and the `optimade.yaml` file (such as i
84
88
  - `optimake convert .` to convert the entry into the JSONL format (see below).
85
89
  - `optimake serve .` to start the OPTIMADE API (this also converts the entry, if needed);
86
90
 
87
- For more detailed information see also `optimake --help`.
91
+ For more detailed information, see `optimake --help`.
92
+
93
+ ### Tutorial
94
+
95
+ 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.
96
+
97
+ To run the tutorial locally, install `optimade-maker[tutorial]` and open the notebook with Jupyter.
88
98
 
89
99
  ### Annotating with `optimade.yaml`
90
100
 
91
- 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`):
101
+ 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`):
92
102
 
93
103
  ```yaml
94
- config_version: 0.1.1
95
- database_description: Simple database
104
+ config_version: 0.2.0
105
+ database_description: Simple DB
96
106
 
97
107
  entries:
98
108
  - entry_type: structures
99
109
  entry_paths:
100
- - file: structures.zip
110
+ - path: structures.zip
101
111
  matches:
102
112
  - cifs/*/*.cif
103
- # (optional) property file and definitions:
113
+ # (optional) properties:
104
114
  property_paths:
105
- - file: properties.csv
115
+ - path: properties.csv
106
116
  property_definitions:
107
117
  - name: energy
108
118
  title: Total energy
@@ -132,11 +142,23 @@ set1/101,2.5
132
142
  structures.zip/cifs/set2/102.cif,3.2
133
143
  ```
134
144
 
145
+ ### Usage in a custom data pipeline
146
+
147
+ 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.
148
+
135
149
  ## Relevant links
136
150
 
137
151
  - [OPTIMADE specification](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst)
138
152
  - [OPTIMADE specification: JSON Lines format](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst#the-optimade-json-lines-format-for-database-exchange)
139
153
 
154
+ ## Citation
155
+
156
+ If you use `optimade-maker` in your research, please cite:
157
+
158
+ > 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](https://doi.org/10.1039/D6DD00125D)
159
+
160
+ Preprint: https://doi.org/10.48550/arXiv.2603.23536
161
+
140
162
  ## For developers
141
163
 
142
164
  ### Releasing a new version
@@ -11,6 +11,8 @@
11
11
  [![PyPI - Version](https://img.shields.io/pypi/v/optimade-maker?color=4CC61E)](https://pypi.org/project/optimade-maker/)
12
12
  ![PyPI - License](https://img.shields.io/pypi/l/optimade-maker?color=blue)
13
13
  ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/materialscloud-org/optimade-maker/ci.yml)
14
+ [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18863676-blue)](https://doi.org/10.5281/zenodo.18863676)
15
+ [![Paper DOI](https://img.shields.io/badge/Paper-10.1039%2FD6DD00125D-blue)](https://doi.org/10.1039/D6DD00125D)
14
16
 
15
17
  </div>
16
18
 
@@ -41,25 +43,31 @@ For a folder containing the data archive and the `optimade.yaml` file (such as i
41
43
  - `optimake convert .` to convert the entry into the JSONL format (see below).
42
44
  - `optimake serve .` to start the OPTIMADE API (this also converts the entry, if needed);
43
45
 
44
- For more detailed information see also `optimake --help`.
46
+ For more detailed information, see `optimake --help`.
47
+
48
+ ### Tutorial
49
+
50
+ 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.
51
+
52
+ To run the tutorial locally, install `optimade-maker[tutorial]` and open the notebook with Jupyter.
45
53
 
46
54
  ### Annotating with `optimade.yaml`
47
55
 
48
- 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`):
56
+ 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`):
49
57
 
50
58
  ```yaml
51
- config_version: 0.1.1
52
- database_description: Simple database
59
+ config_version: 0.2.0
60
+ database_description: Simple DB
53
61
 
54
62
  entries:
55
63
  - entry_type: structures
56
64
  entry_paths:
57
- - file: structures.zip
65
+ - path: structures.zip
58
66
  matches:
59
67
  - cifs/*/*.cif
60
- # (optional) property file and definitions:
68
+ # (optional) properties:
61
69
  property_paths:
62
- - file: properties.csv
70
+ - path: properties.csv
63
71
  property_definitions:
64
72
  - name: energy
65
73
  title: Total energy
@@ -89,11 +97,23 @@ set1/101,2.5
89
97
  structures.zip/cifs/set2/102.cif,3.2
90
98
  ```
91
99
 
100
+ ### Usage in a custom data pipeline
101
+
102
+ 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.
103
+
92
104
  ## Relevant links
93
105
 
94
106
  - [OPTIMADE specification](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst)
95
107
  - [OPTIMADE specification: JSON Lines format](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst#the-optimade-json-lines-format-for-database-exchange)
96
108
 
109
+ ## Citation
110
+
111
+ If you use `optimade-maker` in your research, please cite:
112
+
113
+ > 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](https://doi.org/10.1039/D6DD00125D)
114
+
115
+ Preprint: https://doi.org/10.48550/arXiv.2603.23536
116
+
97
117
  ## For developers
98
118
 
99
119
  ### Releasing a new version
@@ -0,0 +1 @@
1
+ {"id": "Ba", "type": "structures", "links": null, "meta": null, "attributes": {"immutable_id": "cifs/Ba.cif", "last_modified": "2026-04-20T17:03:04.262764", "elements": ["Ba"], "nelements": 1, "elements_ratios": [1.0], "chemical_formula_descriptive": "Ba", "chemical_formula_reduced": "Ba", "chemical_formula_hill": null, "chemical_formula_anonymous": "A", "dimension_types": [1, 1, 1], "nperiodic_dimensions": 3, "lattice_vectors": [[4.22762646696287, 0.0, 0.0], [-1.4092088223209558, 3.9858444574842284, 0.0], [-1.4092088223209558, -1.9929222287421124, 3.4518425557147467]], "space_group_symmetry_operations_xyz": null, "space_group_symbol_hall": null, "space_group_symbol_hermann_mauguin": null, "space_group_symbol_hermann_mauguin_extended": null, "space_group_it_number": null, "cartesian_site_positions": [[0.0, 0.0, 0.0]], "nsites": 1, "species": [{"name": "Ba", "chemical_symbols": ["Ba"], "concentration": [1.0], "mass": null, "original_name": null, "attached": null, "nattached": null}], "species_at_sites": ["Ba"], "assemblies": null, "structure_features": [], "_optimake_density": 3920.0}, "relationships": null}
@@ -0,0 +1,33 @@
1
+
2
+ ##########################################################################
3
+ # Crystallographic Information Format file
4
+ # Produced by PyCifRW module
5
+ #
6
+ # This is a CIF file. CIF has been adopted by the International
7
+ # Union of Crystallography as the standard for data archiving and
8
+ # transmission.
9
+ #
10
+ # For information on this file format, follow the CIF links at
11
+ # http://www.iucr.org
12
+ ##########################################################################
13
+
14
+ data_0
15
+
16
+ loop_
17
+ _atom_site_label
18
+ _atom_site_fract_x
19
+ _atom_site_fract_y
20
+ _atom_site_fract_z
21
+ _atom_site_type_symbol
22
+ Ba1 0.0 0.0 0.0 Ba
23
+ _cell_angle_alpha 109.47122063449069
24
+ _cell_angle_beta 109.47122063449069
25
+ _cell_angle_gamma 109.47122063449069
26
+ _cell_length_a 4.22762646696287
27
+ _cell_length_b 4.22762646696287
28
+ _cell_length_c 4.22762646696287
29
+ loop_
30
+ _symmetry_equiv_pos_as_xyz
31
+ 'x, y, z'
32
+ _symmetry_int_tables_number 1
33
+ _symmetry_space_group_name_H-M 'P 1'
@@ -0,0 +1,37 @@
1
+
2
+ ##########################################################################
3
+ # Crystallographic Information Format file
4
+ # Produced by PyCifRW module
5
+ #
6
+ # This is a CIF file. CIF has been adopted by the International
7
+ # Union of Crystallography as the standard for data archiving and
8
+ # transmission.
9
+ #
10
+ # For information on this file format, follow the CIF links at
11
+ # http://www.iucr.org
12
+ ##########################################################################
13
+
14
+ data_0
15
+
16
+ loop_
17
+ _atom_site_label
18
+ _atom_site_fract_x
19
+ _atom_site_fract_y
20
+ _atom_site_fract_z
21
+ _atom_site_type_symbol
22
+ Ba1 0.0 0.0 0.0 Ba
23
+ Ti1 0.5 0.5 0.5 Ti
24
+ O1 0.0 0.5 0.5 O
25
+ O2 0.5 0.0 0.5 O
26
+ O3 0.5 0.5 0.0 O
27
+ _cell_angle_alpha 90.0
28
+ _cell_angle_beta 90.0
29
+ _cell_angle_gamma 90.0
30
+ _cell_length_a 3.9745754582274
31
+ _cell_length_b 3.9745754582274
32
+ _cell_length_c 3.9745754582274
33
+ loop_
34
+ _symmetry_equiv_pos_as_xyz
35
+ 'x, y, z'
36
+ _symmetry_int_tables_number 1
37
+ _symmetry_space_group_name_H-M 'P 1'
@@ -0,0 +1,46 @@
1
+
2
+ ##########################################################################
3
+ # Crystallographic Information Format file
4
+ # Produced by PyCifRW module
5
+ #
6
+ # This is a CIF file. CIF has been adopted by the International
7
+ # Union of Crystallography as the standard for data archiving and
8
+ # transmission.
9
+ #
10
+ # For information on this file format, follow the CIF links at
11
+ # http://www.iucr.org
12
+ ##########################################################################
13
+
14
+ data_0
15
+
16
+ loop_
17
+ _atom_site_label
18
+ _atom_site_fract_x
19
+ _atom_site_fract_y
20
+ _atom_site_fract_z
21
+ _atom_site_type_symbol
22
+ Sr1 0.33333333333333 0.6666666666666755 0.24999999999999484 Sr
23
+ Sr2 0.6666666666666466 0.3333333333333244 0.7499999999999949 Sr
24
+ C1 0.6665864979541027 0.6665864979514344 0.5 C
25
+ C2 0.6665864979541027 0.6665864979514344 0.0 C
26
+ C3 0.6665864979568098 6.996148258805112e-21 0.5 C
27
+ C4 0.6665864979568098 0.0 0.0 C
28
+ C5 0.999999999997293 0.6665864979514344 0.5 C
29
+ C6 0.999999999997293 0.6665864979514344 0.0 C
30
+ C7 0.9999999999893362 0.3334135020218611 0.5 C
31
+ C8 0.9999999999893362 0.3334135020218611 6.856887615856403e-37 C
32
+ C9 0.33341350203251724 0.3334135020218611 0.5 C
33
+ C10 0.33341350203251724 0.3334135020218611 0.0 C
34
+ C11 0.33341350204319026 1.2871350630101513e-20 0.5 C
35
+ C12 0.33341350204319026 0.0 3.598182623059814e-39 C
36
+ _cell_angle_alpha 90.0
37
+ _cell_angle_beta 90.0
38
+ _cell_angle_gamma 120.00000000006627
39
+ _cell_length_a 4.3196827147571
40
+ _cell_length_b 4.319682714748347
41
+ _cell_length_c 9.7058202670626
42
+ loop_
43
+ _symmetry_equiv_pos_as_xyz
44
+ 'x, y, z'
45
+ _symmetry_int_tables_number 1
46
+ _symmetry_space_group_name_H-M 'P 1'
@@ -0,0 +1,17 @@
1
+ config_version: 0.2.0
2
+ database_description: Simple DB
3
+
4
+ entries:
5
+ - entry_type: structures
6
+ entry_paths:
7
+ - path: cifs
8
+ matches: ["*.cif"]
9
+
10
+ property_paths:
11
+ - path: properties.csv
12
+ property_definitions:
13
+ - name: density
14
+ title: Density
15
+ description: Density of the material
16
+ unit: kg/m^3
17
+ type: float
@@ -0,0 +1,4 @@
1
+ id,density
2
+ SrC6,3381
3
+ BaTiO3,6167
4
+ Ba,3920
@@ -0,0 +1,189 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "a355627a",
6
+ "metadata": {},
7
+ "source": [
8
+ "## `optimade-maker` tutorial\n",
9
+ "\n",
10
+ "This tutorial guides users through the main functionality of the toolkit. The goal is to start an OPTIMADE API server from raw crystal structure data, and demonstrate how to use the API.\n",
11
+ "\n",
12
+ "### 1. Source data\n",
13
+ "\n",
14
+ "The tutorial source data consists of \n",
15
+ "\n",
16
+ "- `./cifs/` - folder containing CIFs (Crystallographic Information Files) downloaded from the MC3D (Materials Cloud 3D Structures Database);\n",
17
+ "- `./properties.csv` -- file containing the densities for each structure (in kg/m^3).\n",
18
+ "\n",
19
+ "### 2. Installing the toolkit\n",
20
+ "\n",
21
+ "In order to start the OPTIMADE API from this data, one should install the toolkit with:\n",
22
+ "\n",
23
+ "```bash\n",
24
+ "> pip install optimade-maker[tutorial]\n",
25
+ "```\n",
26
+ "\n",
27
+ "(note that the `[tutorial]` extra dependency just installs support for this jupyter notebook).\n",
28
+ "\n",
29
+ "### 3. Preparing the `optimade.yaml`\n",
30
+ "\n",
31
+ "To make the source data understandable by `optimade-maker`, one needs to prepare an `optimade.yaml` configuration file. The Pydantic schema of this configuration file is available in the `config.py` file of the library. For this tutorial, the file has already been prepared, but we'll explain it by blocks below.\n",
32
+ "\n",
33
+ "```yaml\n",
34
+ "config_version: 0.2.0\n",
35
+ "database_description: Simple DB\n",
36
+ "```\n",
37
+ "\n",
38
+ "The first two lines contain the version of the config file, and a string to describe the dataset. The config version, in most cases, should typically match the latest version defined by the schema (either checked from `config.py` or the main README).\n",
39
+ "\n",
40
+ "```yaml\n",
41
+ "entries:\n",
42
+ " - entry_type: structures\n",
43
+ " entry_paths:\n",
44
+ " - path: cifs\n",
45
+ " matches: [\"*.cif\"]\n",
46
+ "```\n",
47
+ "\n",
48
+ "The `entries:` block contains the description of OPTIMADE entries (e.g. structures, references, ...). In this tutorial, we are serving only crystal structures, which is described by the `entry_type: structures` line, and the `entry_paths:` describe where to look for the structures. Here, we only define a single path, the `cifs` directory, and look for files that match the `*.cif` pattern.\n",
49
+ "\n",
50
+ "```yaml\n",
51
+ " property_paths:\n",
52
+ " - path: properties.csv\n",
53
+ " property_definitions:\n",
54
+ " - name: density\n",
55
+ " title: Density\n",
56
+ " description: Density of the material\n",
57
+ " unit: kg/m^3\n",
58
+ " type: float\n",
59
+ "```\n",
60
+ "\n",
61
+ "This block (nested inside `entry_type: structures`) shows which file contains the custom properties, and contains its metadata.\n",
62
+ "\n",
63
+ "### 4. Starting the OPTIMADE API\n",
64
+ "\n",
65
+ "We are now ready to start the OPTIMADE API from this dataset. To do this, run the `optimake` CLI in a separate terminal in the tutorial folder:\n",
66
+ "\n",
67
+ "```bash\n",
68
+ "> optimake serve .\n",
69
+ "2026-04-20 17:03:03 INFO optimade-maker: optimade.jsonl doesn't exist. Converting archive.\n",
70
+ "Parsing structures files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 206.09it/s]\n",
71
+ "Constructing OPTIMADE structures entries: 3it [00:00, 1847.44it/s]\n",
72
+ "Parsing property files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 365.33it/s]\n",
73
+ "2026-04-20 17:03:04 INFO optimade-maker: Preparing to start the API...\n",
74
+ "2026-04-20 17:03:04 INFO optimade-maker: Using the MongoMock backend.\n",
75
+ "INFO: [optimade] Using: Mock MongoDB (mongomock) @ localhost:27017\n",
76
+ "2026-04-20 17:03:04 INFO optimade-maker: Populating the database...\n",
77
+ "2026-04-20 17:03:04 INFO optimade-maker: Inserted 3 rows from the JSONL file\n",
78
+ "2026-04-20 17:03:04 INFO optimade-maker: Starting the API\n",
79
+ "INFO: [optimade] Loaded settings from /home/kristjan/.optimade.json\n",
80
+ "INFO: Started server process [1752662]\n",
81
+ "INFO: Waiting for application startup.\n",
82
+ "INFO: Application startup complete.\n",
83
+ "INFO: Uvicorn running on http://127.0.0.1:5000 (Press CTRL+C to quit)\n",
84
+ "```\n",
85
+ "\n",
86
+ "Note, for other functionality and options of the CLI, see `optimake --help`.\n",
87
+ "\n",
88
+ "### 5. Querying the API through Python\n",
89
+ "\n",
90
+ "While the API is running in the background, you can query it according to the OPTIMADE specification (https://www.optimade.org/specification). The following cells show a minimal example on how to do this with Python (converting the structures to ASE (Atomic Simulation Environment) format):"
91
+ ]
92
+ },
93
+ {
94
+ "cell_type": "code",
95
+ "execution_count": 1,
96
+ "id": "c6764a32",
97
+ "metadata": {},
98
+ "outputs": [],
99
+ "source": [
100
+ "import requests\n",
101
+ "from optimade.adapters import Structure\n",
102
+ "\n",
103
+ "BASE_URL = \"http://127.0.0.1:5000\"\n",
104
+ "\n",
105
+ "\n",
106
+ "def get_structures(filter_):\n",
107
+ " response = requests.get(f\"{BASE_URL}/structures?filter={filter_}\")\n",
108
+ " response.raise_for_status()\n",
109
+ " return [Structure(entry).as_ase for entry in response.json()[\"data\"]]"
110
+ ]
111
+ },
112
+ {
113
+ "cell_type": "code",
114
+ "execution_count": 2,
115
+ "id": "af1a9742",
116
+ "metadata": {},
117
+ "outputs": [
118
+ {
119
+ "name": "stdout",
120
+ "output_type": "stream",
121
+ "text": [
122
+ "Atoms(symbols='BaTiO3', pbc=True, cell=[3.9745754582274, 3.9745754582274, 3.9745754582274])\n",
123
+ "Atoms(symbols='Sr2C12', pbc=True, cell=[[4.3196827147571, 0.0, 0.0], [-2.1598413573785002, 3.740954967258099, 0.0], [0.0, 0.0, 9.7058202670626]])\n"
124
+ ]
125
+ }
126
+ ],
127
+ "source": [
128
+ "# OPTIMADE query: Get all structures with more than 1 element\n",
129
+ "for structure in get_structures(\"nelements > 1\"):\n",
130
+ " print(structure)"
131
+ ]
132
+ },
133
+ {
134
+ "cell_type": "code",
135
+ "execution_count": 3,
136
+ "id": "885faa54",
137
+ "metadata": {},
138
+ "outputs": [
139
+ {
140
+ "name": "stdout",
141
+ "output_type": "stream",
142
+ "text": [
143
+ "Atoms(symbols='Ba', pbc=True, cell=[[4.22762646696287, 0.0, 0.0], [-1.4092088223209558, 3.9858444574842284, 0.0], [-1.4092088223209558, -1.9929222287421124, 3.4518425557147467]])\n",
144
+ "Atoms(symbols='BaTiO3', pbc=True, cell=[3.9745754582274, 3.9745754582274, 3.9745754582274])\n"
145
+ ]
146
+ }
147
+ ],
148
+ "source": [
149
+ "# OPTIMADE query: filter based on the custom density property\n",
150
+ "# Note that the default prefix for custom properties is \"_optimake_\" for optimade-maker\n",
151
+ "for structure in get_structures(\"_optimake_density > 3800\"):\n",
152
+ " print(structure)"
153
+ ]
154
+ },
155
+ {
156
+ "cell_type": "markdown",
157
+ "id": "d3a960cb",
158
+ "metadata": {},
159
+ "source": [
160
+ "### 6. Using the API with an external client\n",
161
+ "\n",
162
+ "The local API can also be queried with existing clients, such as the Materials Cloud OPTIMADE Client (https://optimadeclient.materialscloud.io), which allows to connect to a custom API URL.\n",
163
+ "\n",
164
+ "To try it out, while the API is running in the background, open: https://optimadeclient.materialscloud.io/?base_url=http://127.0.0.1:5000"
165
+ ]
166
+ }
167
+ ],
168
+ "metadata": {
169
+ "kernelspec": {
170
+ "display_name": "optimade-maker",
171
+ "language": "python",
172
+ "name": "python3"
173
+ },
174
+ "language_info": {
175
+ "codemirror_mode": {
176
+ "name": "ipython",
177
+ "version": 3
178
+ },
179
+ "file_extension": ".py",
180
+ "mimetype": "text/x-python",
181
+ "name": "python",
182
+ "nbconvert_exporter": "python",
183
+ "pygments_lexer": "ipython3",
184
+ "version": "3.12.12"
185
+ }
186
+ },
187
+ "nbformat": 4,
188
+ "nbformat_minor": 5
189
+ }
@@ -1,4 +1,4 @@
1
- config_version: 0.1.1
1
+ config_version: 0.2.0
2
2
 
3
3
  database_description: >-
4
4
  This example aiida database contains optimized structures and band structure calculations.
@@ -13,7 +13,7 @@ entries:
13
13
  # If all properties are stored in the AiiDA database,
14
14
  # this can be omitted. But additional properties can be
15
15
  # provided via a csv file.
16
- - file: data.csv
16
+ - path: data.csv
17
17
  property_definitions:
18
18
  # ----
19
19
  - name: test_extra
@@ -1,4 +1,4 @@
1
- config_version: 0.1.0
1
+ config_version: 0.2.0
2
2
 
3
3
  database_description: >-
4
4
  This database contains some bzipped pymatgen objects.
@@ -6,7 +6,7 @@ database_description: >-
6
6
  entries:
7
7
  - entry_type: structures
8
8
  entry_paths:
9
- - file: part_1.json.bz2
9
+ - path: part_1.json.bz2
10
10
  matches:
11
11
  - part_1.json
12
12
  property_definitions:
@@ -0,0 +1 @@
1
+ optimade.jsonl
@@ -0,0 +1 @@
1
+ {"id": "101", "type": "structures", "links": null, "meta": null, "attributes": {"immutable_id": "cifs/101.cif", "last_modified": "2026-04-18T16:47:32.585916", "elements": ["Ba", "C", "N", "S"], "nelements": 4, "elements_ratios": [0.14285714285714285, 0.2857142857142857, 0.2857142857142857, 0.2857142857142857], "chemical_formula_descriptive": "C4Ba2N4S4", "chemical_formula_reduced": "BaC2N2S2", "chemical_formula_hill": null, "chemical_formula_anonymous": "A2B2C2D", "dimension_types": [1, 1, 1], "nperiodic_dimensions": 3, "lattice_vectors": [[6.3587627540404945, 0.0, 0.0], [-2.672647488887009, 5.769819681958754, 0.0], [0.25844951934994664, -0.16511343006546234, 8.71190314896161]], "space_group_symmetry_operations_xyz": null, "space_group_symbol_hall": null, "space_group_symbol_hermann_mauguin": null, "space_group_symbol_hermann_mauguin_extended": null, "space_group_it_number": null, "cartesian_site_positions": [[3.4987802863851005, 5.049341739457014, 6.533927361693402], [0.4457844982025419, 0.5553645123824795, 2.177975787264444], [0.37416734784252487, 2.642448780492868, 5.291889331690525], [2.6281157156591126, 1.202488098280357, 7.775965391700042], [3.5703974366609055, 2.962257471400425, 3.420013817271085], [1.316449068841148, 4.402218153614962, 0.9359377571616379], [0.3512600296798777, 4.156339511491648, 5.900755701251229], [4.011419364830723, 1.818004876809729, 7.167099022143105], [3.5933047547393455, 1.4483667404554434, 2.8111474477141454], [-0.06685458032729186, 3.786701375083563, 1.5448041268185058], [0.3773832460379156, 1.5350786992068879, 4.8597303327393915], [1.621957615426957, 0.7399681351855376, 8.208124390751108], [3.567181538468686, 4.069627552684378, 3.8521728163221476], [2.3226071690796486, 4.864738116705728, 0.5037787583104332]], "nsites": 14, "species": [{"name": "S", "chemical_symbols": ["S"], "concentration": [1.0], "mass": null, "original_name": null, "attached": null, "nattached": null}, {"name": "Ba", "chemical_symbols": ["Ba"], "concentration": [1.0], "mass": null, "original_name": null, "attached": null, "nattached": null}, {"name": "N", "chemical_symbols": ["N"], "concentration": [1.0], "mass": null, "original_name": null, "attached": null, "nattached": null}, {"name": "C", "chemical_symbols": ["C"], "concentration": [1.0], "mass": null, "original_name": null, "attached": null, "nattached": null}], "species_at_sites": ["Ba", "Ba", "C", "C", "C", "C", "S", "S", "S", "S", "N", "N", "N", "N"], "assemblies": null, "structure_features": [], "_optimake_energy": 2.5}, "relationships": null}
@@ -0,0 +1,46 @@
1
+
2
+ ##########################################################################
3
+ # Crystallographic Information Format file
4
+ # Produced by PyCifRW module
5
+ #
6
+ # This is a CIF file. CIF has been adopted by the International
7
+ # Union of Crystallography as the standard for data archiving and
8
+ # transmission.
9
+ #
10
+ # For information on this file format, follow the CIF links at
11
+ # http://www.iucr.org
12
+ ##########################################################################
13
+
14
+ data_0
15
+
16
+ loop_
17
+ _atom_site_label
18
+ _atom_site_fract_x
19
+ _atom_site_fract_y
20
+ _atom_site_fract_z
21
+ _atom_site_type_symbol
22
+ Ba1 0.8965924582118168 0.8965924581978235 0.7499999999968082 Ba
23
+ Ba2 0.10340754179751976 0.10340754179284 0.25000000000275957 Ba
24
+ C1 0.23395238080264336 0.4753604312934071 0.6074320663586895 C
25
+ C2 0.47536043129806416 0.2339523807979867 0.892567933635359 C
26
+ C3 0.7660476191973566 0.524639568706593 0.39256793364131043 C
27
+ C4 0.5246395687019131 0.7660476192020365 0.10743206635317039 C
28
+ S1 0.3386310702634352 0.7397413705299642 0.6773210859161757 S
29
+ S2 0.7397413705252843 0.3386310702681149 0.8226789140783051 S
30
+ S3 0.6613689297272285 0.2602586294793724 0.32267891408425636 S
31
+ S4 0.26025862947471556 0.6613689297318851 0.17732108592169485 S
32
+ N1 0.15520998661097707 0.2820163252279592 0.5578264874671652 N
33
+ N2 0.2820163252326391 0.15520998660629753 0.9421735125383539 N
34
+ N3 0.8447900133890457 0.7179836747720179 0.44217351254430515 N
35
+ N4 0.717983674767384 0.8447900133936794 0.05782648747311654 N
36
+ _cell_angle_alpha 91.69894776135195
37
+ _cell_angle_beta 88.30105223864805
38
+ _cell_angle_gamma 114.8541200717058
39
+ _cell_length_a 6.3587627540404945
40
+ _cell_length_b 6.3587627540404945
41
+ _cell_length_c 8.717299758281083
42
+ loop_
43
+ _symmetry_equiv_pos_as_xyz
44
+ 'x, y, z'
45
+ _symmetry_int_tables_number 1
46
+ _symmetry_space_group_name_H-M 'P 1'
@@ -0,0 +1,34 @@
1
+
2
+ ##########################################################################
3
+ # Crystallographic Information Format file
4
+ # Produced by PyCifRW module
5
+ #
6
+ # This is a CIF file. CIF has been adopted by the International
7
+ # Union of Crystallography as the standard for data archiving and
8
+ # transmission.
9
+ #
10
+ # For information on this file format, follow the CIF links at
11
+ # http://www.iucr.org
12
+ ##########################################################################
13
+
14
+ data_0
15
+
16
+ loop_
17
+ _atom_site_label
18
+ _atom_site_fract_x
19
+ _atom_site_fract_y
20
+ _atom_site_fract_z
21
+ _atom_site_type_symbol
22
+ Sr1 0.0 0.0 0.0 Sr
23
+ C1 0.5 0.5 0.5 C
24
+ _cell_angle_alpha 60.00000000000001
25
+ _cell_angle_beta 60.00000000000001
26
+ _cell_angle_gamma 60.00000000000001
27
+ _cell_length_a 4.006498849786306
28
+ _cell_length_b 4.006498849786306
29
+ _cell_length_c 4.006498849786306
30
+ loop_
31
+ _symmetry_equiv_pos_as_xyz
32
+ 'x, y, z'
33
+ _symmetry_int_tables_number 1
34
+ _symmetry_space_group_name_H-M 'P 1'
@@ -0,0 +1,17 @@
1
+ config_version: 0.2.0
2
+ database_description: Simple DB
3
+
4
+ entries:
5
+ - entry_type: structures
6
+ entry_paths:
7
+ - path: cifs
8
+ matches: ["*.cif"]
9
+ # (optional) properties:
10
+ property_paths:
11
+ - path: properties.json
12
+ property_definitions:
13
+ - name: energy
14
+ title: Total energy
15
+ description: DFT total energy
16
+ unit: eV/atom
17
+ type: float
@@ -0,0 +1,8 @@
1
+ {
2
+ "101": {
3
+ "energy": 2.5
4
+ },
5
+ "102": {
6
+ "energy": 3.2
7
+ }
8
+ }