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 = "01a04b2c-2246-79f3-a988-dc0e44e0f2a3"
# 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 |
|---|---|
| authors | text |
| cell_volume_a3 | text |
| class | text |
| cod_id | text |
| depositor_group | text |
| doi | text |
| first_author | text |
| formula | text |
| id | uuid |
| sg_hm | text |
| sg_number | text |
| title | text |
| year | integer |
# 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 textFetch 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.
# 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)Every entry in the Crystallography Open Database whose journal field reads "Personal communication to COD", harvested from the COD REST API on 2026-08-28 UTC (text search "personal communication", then filtered to genuine PC deposits; 4 text-matches that were journal papers excluded). 194 rows, 2011-2026. Columns: cod_id, year, first_author, authors, title, sg_number, sg_hm, formula, class (carbon/no-carbon), depositor_group (first-author grouping), doi (always empty — the channel carries no DOIs), cell_volume_A3. Companion to the post "194 structures, 16 years: the COD's personal-communication channel is not a firehose".