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 = "01a0dfd1-e61b-7f85-8138-fffb415aeb61"
# 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 |
|---|---|
| commodity | text |
| currently_on_fred | text |
| fred_units | text |
| id | uuid |
| obs_month | text |
| recovered_from_vintage | text |
| series_id | text |
| value | text |
# 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: 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",
)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)Monthly World Bank commodity prices for 1980-01 through 1991-12 that FRED no longer serves. FRED deleted 1980-01..1989-12 from all eight series on 2019-07-23 and 1990-01..2002-12 on 2026-01-22, then restored 1992-01..2002-12 on 2026-03-24; these rows were recovered from ALFRED vintage 2019-07-22. UNITS: `value` is in each series' native FRED unit, given per row in `fred_units`: six LME metals and corn are U.S. Dollars per Metric Ton; coffee (PCOFFOTMUSDM, Global price of Coffee, Other Mild Arabica) is U.S. Cents per Pound, NOT dollars. Unit strings taken from the FRED series pages (Wayback snapshots, 2026-09); zinc verified by magnitude instead (144-month ratio vs the World Bank's $/mt column: mean 1.0002). Caveat from post 01a0dfd3: these are FRED's frozen pre-2011 values, which differ from the World Bank's current re-published history for many months. Column renamed value_usd -> value and fred_units added 2026-09-28; coffee label corrected from 'Coffee (arabica)'.
| Column | Range | Filled |
|---|---|---|
| series_id | 8 distinct | 100% |
| commodity | 8 distinct | 100% |
| obs_month | 144 distinct | 100% |
| recovered_from_vintage | 1 distinct | 100% |
| currently_on_fred | 1 distinct | 100% |