Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

bathos

PyPI Python 3.13+ License: Apache 2.0 Documentation

Public alpha — experimental software. bathos is under active development and should be considered a work in progress. APIs, catalog schema, and CLI commands may change between releases without a deprecation period. It is used in production by the author, but expect rough edges and missing features. Feedback and bug reports welcome.

Local-first, zero-server experiment tracking for researchers working across multiple projects and SLURM clusters.

Never lose track of what ran, what it produced, or whether results are still valid.

Install

uv tool install bathos           # base install (includes Rich CLI)
uv tool install 'bathos[viz]'    # adds bth view + bth export --html

Quick start

# Register this project (creates .bth.toml + scripts/ skeleton)
bth init

# Run and track an experiment
bth run scripts/experiments/benchmark_tip3p.py -- --n-steps 1000 --out outputs/run1.parquet

# Query recent runs
bth ls --since 7d
bth show <run-id>

# Check catalog runs for git-drift freshness
bth check [--status <status>] [--check-outputs]

# Escape hatch: raw DuckDB SQL against the catalog
bth sql "SELECT project_slug, count(*) FROM runs GROUP BY 1"

bth run flags

v0.3+ flags:

  • --agent-mode collaborative|autonomous — declare whether this run is agent-driven
  • --derived-from <run-id> — record parent run for lineage tracking
  • --campaign <campaign-id> — associate this run with a campaign
  • --no-sidecar — bypass sidecar enforcement (use for ad-hoc runs)

CLI Reference

Core commands:

  • bth init — initialize bathos in a project
  • bth run — execute and track an experiment
  • bth ls — list recent runs
  • bth show <run-id> — display run details
  • bth find — search runs by criteria
  • bth sql — raw DuckDB query against catalog
  • bth check — check catalog runs for git-drift freshness
  • bth lineage <run-id> — show ancestor chain following parent_run_id links
  • bth sprint-audit [--hours N] — audit recent runs across all registered projects
  • bth lint [--project-root PATH] — check scripts/ for naming conventions and missing sidecars
  • bth new-experiment <name> — scaffold a new experiment script and sidecar
  • bth migrate — upgrade cool-tier Parquet fragments to current schema version
  • bth migrate-to-project-subdirs [--dry-run] — move flat catalog runs into runs/<slug>/ subdirs (v0.4+)
  • bth export — export the using-bathos skill and register MCP server
  • bth export --html [--out report.html] [--project slug] [--campaign id] — self-contained HTML report (requires bathos[viz])
  • bth view [--port 8080] [--project slug] [--no-open] — local FastAPI dashboard (requires bathos[viz])

bth sync — Sync cool-tier catalog to/from cluster (v0.4+: per-project filtered)

  • bth sync [<remote>] — push only this project's runs to the remote (filtered by project_slug)
  • bth sync [<remote>] --pull — pull only this project's runs from the remote
  • Output: Pushed 47 runs (filtered 275 from other projects) to 'engaging' in 1.2s
  • Config: sync_filter = "none" in .bth.toml disables filtering (pushes all projects)

bth remote — Manage sync remotes

  • bth remote add <name> <url> — add an SSH remote for catalog sync
  • bth remote list — list configured remotes
  • bth remote remove <name> — remove a remote
  • bth remote test <name> — test SSH connectivity to a remote

bth postmortem — Retrospective tracking for completed experiments (v0.4.1+)

  • bth postmortem validate <file> — validate a *.bth.postmortem.toml file (refutation consistency, asset checksums, git drift)

bth campaign — Manage experiment campaigns (v0.3+)

  • bth campaign create <id> --hypothesis <text> — create a new campaign
  • bth campaign add <run-id> --campaign <id> — associate a run with a campaign
  • bth campaign ls — list campaigns
  • bth campaign show <id> — show campaign details and runs
  • bth campaign review <id> — statistical summary and anomaly detection
  • bth campaign conclude <id> --outcome <label> — close campaign with outcome

Script conventions

bth init scaffolds the following structure in your project:

Directory Purpose Naming Tracked
scripts/experiments/ Typer experiment runners verb_noun.py Yes
scripts/analysis/ Post-hoc analysis and plots verb_noun.py Optional
scripts/validation/ Correctness checks verb_noun.py Optional
scripts/benchmarks/ Performance benchmarks verb_noun.py Yes
scripts/data/ Data pipeline / conversion verb_noun.py No
scripts/slurm/ SLURM job files + env helpers verb_noun.slurm Via wrapper
scripts/debug/ Debug specific issues YYMMDD_desc.py No
scripts/explore/ Open-ended investigation YYMMDD_desc.py No
scripts/scratch/ Catchall / ephemeral YYMMDD_desc.py No (gitignored)

Python decorator

For Typer-based scripts that want direct integration:

import bth

@bth.experiment(name="benchmark_tip3p", tags=["tip3p", "nvt"])
def main(n_steps: int, out: Path):
    ...

SLURM

bth init generates a scripts/slurm/_bth_env.sh helper. Source it in job scripts to get automatic provenance capture for batch runs.

Catalog

All runs land in ~/.bth/catalog/ as DuckDB + Parquet. Query with bth ls, bth find, or raw bth sql.

Documentation

Full documentation is available at https://bathos.readthedocs.io.

Download files

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

Source Distribution

bathos-0.13.0a2.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

bathos-0.13.0a2-py3-none-any.whl (386.9 kB view details)

Uploaded Python 3

File details

Details for the file bathos-0.13.0a2.tar.gz.

File metadata

  • Download URL: bathos-0.13.0a2.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bathos-0.13.0a2.tar.gz
Algorithm Hash digest
SHA256 cfdda75bce2cba5d50c1e95f43faed749fb46a21af5a2ee58ad6ab3d83dec42a
MD5 2444c28a848e8f0b23bfd99946ae1b04
BLAKE2b-256 b298bf3bc9777219c7e7cd56d72945eb573375cdd356335e6cd358caa53a3ab3

See more details on using hashes here.

File details

Details for the file bathos-0.13.0a2-py3-none-any.whl.

File metadata

  • Download URL: bathos-0.13.0a2-py3-none-any.whl
  • Upload date:
  • Size: 386.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bathos-0.13.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 c6b0c3940fd49a926d0ce41a78bec64c920360c6d4318bdc6911dcf97b58e9bd
MD5 793e6e10b8e79ceb1790456d08a638f9
BLAKE2b-256 8f37339de5e6f0d317d13e86ccd15f9893809ecc07e94000f0c5deb3a4770f6e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.13.0a2 This release

2 files

0.12.0

2 files

0.9.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page