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 = "9c942f1f-e2e3-49bd-abec-f40b392121e9"
# 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 |
|---|---|
| cosine_dist_to_mnal | real |
| cosine_dist_to_ndfeb | real |
| cosine_dist_to_smco5 | real |
| curie_temperature | real |
| formula_pretty | text |
| has_rare_earth | boolean |
| id | uuid |
| magnetic_density | real |
| mp_id | text |
| total_magnetic_moment | real |
| volume | real |
# 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.
# Option 1: Query data by dataset ID (returns Pandas DataFrame)
df = ouro.datasets.query(dataset_id)
print(df.head())
# Option 2: Load data by table name (faster for large datasets)
table_name = dataset.metadata["table_name"] # e.g., "distance_to_known_magnets"
df = ouro.datasets.load(table_name)
print(len(df))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.
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)This dataset has a set of 34,000 ferro/ferrimagnetic materials from Materials Project, their formula, if they include rare earth elements, magnetic moment, volume, magnetic density, a predicted Curie temperature, and cosine distances to some known permanent magnets like NdFeB. Distances are based on a 256 dimension embedding from Orb v2 latent space.
In our exploration of magnetic materials, we did some embedding via Orb v2 and some dimensionality reduction.