Learn how to interact with this dataset using the Ouro SDK or REST API.
API access requires an API key. Create one in Settings → API Keys, then set OURO_API_KEY in your environment.
Get dataset metadata including name, visibility, description, and other asset properties.
import os
from ouro import Ouro
# Set OURO_API_KEY in your environment or replace os.environ.get("OURO_API_KEY")
ouro = Ouro(api_key=os.environ.get("OURO_API_KEY"))
dataset_id = "01a15c82-afe9-73cc-b0de-759388e72f42"
# Retrieve dataset metadata
dataset = ouro.datasets.retrieve(dataset_id)
print(dataset.name, dataset.visibility)
print(dataset.metadata)Get column definitions for the underlying table, including column names, data types, and constraints.
| Column | Type |
|---|---|
| a | double precision |
| alpha | double precision |
| authors | text |
| b | double precision |
| beta | double precision |
| c | double precision |
| cell_volume | double precision |
| chemical_name | text |
| chemsys | text |
| cif | text |
| common_name | text |
| deposited | text |
| disordered | boolean |
| doi | text |
| duplicate_of | bigint |
| experimental | boolean |
| first_page | text |
| formula | text |
| gamma | double precision |
| has_coordinates | boolean |
| id | bigint |
| journal | text |
| journal_volume | text |
| method | text |
| mineral | text |
| nelements | bigint |
| num_atoms | bigint |
| organic | boolean |
| pressure_kpa | double precision |
| primitive_atoms | bigint |
| r_factor | double precision |
| radiation | text |
| reduced_formula | text |
| revision | bigint |
| space_group | text |
| space_group_number | bigint |
| status | text |
| temperature_k | double precision |
| title | text |
| url | text |
| year | bigint |
| z | double precision |
Fetch the dataset's rows. Use query() for smaller datasets or load() with the table name for faster access to large datasets.
Update dataset metadata (visibility, description, etc.) and optionally write new rows to the table. Writing new data will replace the existing data in the table. Requires write or admin permission on the dataset.
# Get column definitions for the underlying table
columns = ouro.datasets.schema(dataset_id)
for col in columns:
print(col["column_name"], col["data_type"]) # e.g., age integer, name text# Option 1: All rows as a Pandas DataFrame
df = ouro.datasets.query(dataset_id)
print(df.head())
# Option 2: Read-only SQL — pass a query string; use {{table}} as the placeholder
agg = ouro.datasets.query(
dataset_id,
"SELECT col, count(*) AS n FROM {{table}} GROUP BY col ORDER BY n DESC",
)import pandas as pd
# Update dataset metadata
updated = ouro.datasets.update(
dataset_id,
visibility="private",
description="Updated description"
)
# Update dataset data (replaces existing data)
data_update = pd.DataFrame([
{"name": "Charlie", "age": 33},
{"name": "Diana", "age": 28},
])
updated = ouro.datasets.update(dataset_id, data=data_update)Journal of Applied Crystallography · 2009
Every released entry of the Crystallography Open Database (COD): experimentally determined crystal structures of minerals, inorganic, metal-organic and organic compounds, one row per COD entry.
Metadata for every entry: formula, cell, space group, temperature and pressure, R factor, method, and the paper it was published in (journal, year, DOI).
The CIF itself for inorganic entries (no carbon-hydrogen compounds), as COD publishes it; the few largest lose the reflection data and SHELX files embedded in them. reduced_formula, num_atoms and primitive_atoms (sites in its primitive cell) describe that CIF as pymatgen reads it.
experimental is false for COD's few structures from calculations. duplicate_of and status (retracted, warnings, errors) are COD's own.
url opens the entry on COD.
Ouro's Crystal DB novelty check matches structures against these CIFs alongside Materials Project, Alexandria and GNoME.
COD's data is in the public domain (CC0). Please acknowledge the original authors of each structure and cite COD: Gražulis et al., J. Appl. Cryst. 42, 726 (2009), doi:10.1107/S0021889809016690.
| Column | Range | Mean | Filled |
|---|---|---|---|
| id | 1,000,000–9,017,883 | 4,753,470 | 100% |
| formula | 177,727 distinct | — | 100% |
| reduced_formula | 174,886 distinct | — | 100% |
| chemsys | 31,842 distinct | — | 100% |
| nelements | 1–20 | 5.019 | 100% |
| num_atoms | 1–29,784 | 284.6 | 100% |
| primitive_atoms | 1–10,240 | 52.14 | 14% |
| space_group | 564 distinct | — | 100% |
| space_group_number | 1–230 | 33.08 | 99% |
| a | 1.894–128.6 | 12.64 | 100% |
| b | 1.894–129.9 | 13.51 | 100% |
| c | 1.51–476 | 16.53 | 100% |
| alpha | 17.51–150.2 | 89.75 | 100% |
| beta | 17.51–171 | 95.46 | 100% |
| gamma | 17.51–149.9 | 91.11 | 100% |
| cell_volume | 10.71–701,860 | 3,259 | 100% |
| z | 1–2,352 | 4.173 | 100% |
| mineral | 2,594 distinct | — | 3% |
| common_name | 18,639 distinct | — | 10% |
| chemical_name | 52,420 distinct | — | 26% |
| temperature_k | 0–16,050 | 203.3 | 89% |
| pressure_kpa | 0–12,320,000,000 | 13,567,740 | 1% |
| method | 3 distinct | — | 1% |
| radiation | 229 distinct | — | 87% |
| r_factor | 0–514.8 | 0.05643 | 87% |
| experimental | 2 distinct | — | 100% |
| organic | 2 distinct | — | 100% |
| disordered | 2 distinct | — | 100% |
| has_coordinates | 2 distinct | — | 100% |
| duplicate_of | 1,000,002–9,016,765 | 4,622,726 | 1% |
| status | 3 distinct | — | 0% |
| authors | 95,906 distinct | — | 99% |
| title | 105,858 distinct | — | 99% |
| journal | 1,105 distinct | — | 100% |
| year | 1,917–2,026 | 2,010 | 100% |
| journal_volume | 690 distinct | — | 87% |
| first_page | 24,315 distinct | — | 92% |
| doi | 89,613 distinct | — | 91% |
| revision | 34,330–306,984 | 241,500 | 100% |
| deposited | 1,258 distinct | — | 100% |
| url | 215,581 distinct | — | 100% |
| cif | 30,350 distinct | — | 14% |