Skip to main content

Download WandB runs and histories to local files

Project description

dr-wandb

Download Weights & Biases experiment data to local pickle or parquet files for offline analysis.

Installation

# CLI tool
uv tool install dr-wandb

# Or as a library
uv add dr-wandb

Authentication

Configure Weights & Biases authentication:

wandb login

Or set the API key as an environment variable:

export WANDB_API_KEY=your_api_key_here

CLI Usage

wandb-download ENTITY PROJECT OUTPUT_DIR [OPTIONS]

Options:
  --output-format  [pkl|parquet]  Output format (default: pkl)
  --runs-only                     Download only run metadata, skip histories
  --runs-per-page  INTEGER        Runs to fetch per API call (default: 500)
  --log-every      INTEGER        Log progress every N runs (default: 20)

Examples

Download runs and histories as pickle files:

wandb-download my-team my-project ./data

Download as parquet files:

wandb-download my-team my-project ./data --output-format parquet

Download only run metadata (skip histories):

wandb-download my-team my-project ./data --runs-only

Output Files

Pickle format (default):

  • {entity}_{project}_runs.pkl - List of run dictionaries
  • {entity}_{project}_histories.pkl - List of history entry lists per run

Parquet format:

  • {entity}_{project}_runs.parquet - Run metadata as DataFrame
  • {entity}_{project}_histories.parquet - All history entries flattened

Library Usage

from dr_wandb import fetch_project_runs, serialize_run, serialize_history_entry

# Fetch all runs and histories
runs, histories = fetch_project_runs(
    entity="my-team",
    project="my-project",
    include_history=True,
)

# Each run is a dict with keys:
# run_id, run_name, state, project, entity, created_at,
# config, summary, wandb_metadata, system_metrics, system_attrs, sweep_info

# Each history entry is a dict with keys:
# run_id, step, timestamp, runtime, wandb_metadata, metrics

Pydantic Models

The library uses pydantic models for type-safe data handling:

from dr_wandb.run_record import RunRecord
from dr_wandb.history_entry_record import HistoryEntryRecord

# Convert a wandb run to a typed record
record = RunRecord.from_wandb_run(wandb_run)
data = record.model_dump()  # Get as dict
json_str = record.model_dump_json()  # Get as JSON string

Data Schema

RunRecord fields:

Field Type Description
run_id str Unique run identifier
run_name str Human-readable run name
state str finished, running, crashed, failed, killed
project str Project name
entity str Entity (user/team) name
created_at datetime Run creation timestamp
config dict Experiment configuration
summary dict Final metrics and outputs
wandb_metadata dict Platform metadata
system_metrics dict Hardware/system info
system_attrs dict Additional system attributes
sweep_info dict Hyperparameter sweep info

HistoryEntryRecord fields:

Field Type Description
run_id str Parent run identifier
step int | None Training step number
timestamp datetime | None Time of logging
runtime int | None Seconds since run start
wandb_metadata dict Platform logging metadata
metrics dict All logged metrics

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dr_wandb-0.2.0.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dr_wandb-0.2.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file dr_wandb-0.2.0.tar.gz.

File metadata

  • Download URL: dr_wandb-0.2.0.tar.gz
  • Upload date:
  • Size: 49.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for dr_wandb-0.2.0.tar.gz
Algorithm Hash digest
SHA256 30f6bfd824e8e2c745abb3fd1dbd745627637d79dc2c8e65821b88700f166af8
MD5 1b8cb2708ce266c58e91536c4306da39
BLAKE2b-256 e8417caad2f9d0731952a7213f04d01578e6c6536d7a1a512644dbe4af032a0a

See more details on using hashes here.

File details

Details for the file dr_wandb-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dr_wandb-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for dr_wandb-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c87695ff748cbcf262785601b52ca1843a0f2ab8cc968d87655895870e7f2710
MD5 b4975deccb76ec55340a27abdfcc2aea
BLAKE2b-256 b10fb7b6f245d374ca96066dc06c568561ac536677cc97c3e3dd740e1aaf493f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page