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 = "01a02aa3-a5aa-72aa-96a7-78adf414840f"
# 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 |
|---|---|
| assayed_composition | text |
| calibration_metadata | text |
| failure_reason | text |
| id | uuid |
| instrument | text |
| lattice_parameters | text |
| magnetic_order | text |
| measurement_temperature_k | text |
| moment_normalization_basis | text |
| nitridation_conditions | text |
| nominal_composition | text |
| notes | text |
| ordering_temperature_k | text |
| phase_fractions | text |
| raw_data_ref | text |
| result_type | text |
| sample_id | text |
| saturation_magnetization_am2_per_kg | text |
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)Lab-deposit template for the Mn-Ge-N nitrogen-vacancy series (Mn12Ge4N3 to Mn3GeN). One row per specimen, capturing successful samples and null results equally. Required fields: nominal + assayed composition, phase fractions, lattice parameters, nitridation conditions, raw-data file reference (Ouro file asset UUID or repository URL), instrument + calibration metadata, magnetic-order assignment, moment normalization basis, and an explicit failure reason when the result is a null or failed sample. The two EXAMPLE rows are illustrative placeholders, not measurements. Accompanies the Mn-Ge-N vacancy-series experiment matrix (asset 01a02a6c-95c1-7396-88f0-692351c3c5f6) and the measured magnetic data call (asset 019fe745-c604-7a79-b2be-497c19118cb4).