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.
Retrieve dataset
Get dataset metadata including name, visibility, description, and other asset properties.
import osfrom 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 = "019f8b88-7cfa-7ba5-a633-150e16b0dc94"# Retrieve dataset metadatadataset = ouro.datasets.retrieve(dataset_id)print(dataset.name, dataset.visibility)print(dataset.metadata)
Read schema
Get column definitions for the underlying table, including column names, data types, and constraints.
14 columns
Column
Type
case_id
text
energy_change_eV
real
failure_class
text
final_energy_eV
real
id
uuid
input_SG
text
input_cif_id
uuidAsset · file
material
text
material_family
text
model
text
notes
text
output_SG
text
output_cif_id
uuidAsset · file
symmetry_preserved
integer
# Get column definitions for the underlying tablecolumns = ouro.datasets.schema(dataset_id)for col in columns: print(col["column_name"], col["data_type"]) # e.g., age integer, name text
Query data
Fetch the dataset's rows. Use query() for smaller datasets or load() with the table name for faster access to large datasets.
# Option 1: All rows as a Pandas DataFramedf = ouro.datasets.query(dataset_id)print(df.head())# Option 2: Read-only SQL — pass a query string; use {{table}} as the placeholderagg = ouro.datasets.query( dataset_id, "SELECT col, count(*) AS n FROM {{table}} GROUP BY col ORDER BY n DESC",)
Update dataset
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.
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.
Retrieve dataset
Get dataset metadata including name, visibility, description, and other asset properties.
import osfrom 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 = "019f8b88-7cfa-7ba5-a633-150e16b0dc94"# Retrieve dataset metadatadataset = ouro.datasets.retrieve(dataset_id)print(dataset.name, dataset.visibility)print(dataset.metadata)
Read schema
Get column definitions for the underlying table, including column names, data types, and constraints.
14 columns
Column
Type
case_id
text
energy_change_eV
real
failure_class
text
final_energy_eV
real
id
uuid
input_SG
text
input_cif_id
uuidAsset · file
material
text
material_family
text
model
text
notes
text
output_SG
text
output_cif_id
uuidAsset · file
symmetry_preserved
integer
# Get column definitions for the underlying tablecolumns = ouro.datasets.schema(dataset_id)for col in columns: print(col["column_name"], col["data_type"]) # e.g., age integer, name text
Query data
Fetch the dataset's rows. Use query() for smaller datasets or load() with the table name for faster access to large datasets.
# Option 1: All rows as a Pandas DataFramedf = ouro.datasets.query(dataset_id)print(df.head())# Option 2: Read-only SQL — pass a query string; use {{table}} as the placeholderagg = ouro.datasets.query( dataset_id, "SELECT col, count(*) AS n FROM {{table}} GROUP BY col ORDER BY n DESC",)
Update dataset
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.