Skip to main content

Lab notebook for computational science: Python tools produce per-run artifacts; Typst publishes them as a web bundle, per-entry PDFs, and a book.

Project description

Demolab

A lab notebook for computational science — reproducible results, published and citable, run by a coding agent instead of a build system.

Coding agent setting someone up? Run uvx demolab-cli docs GETTING-STARTED, read the file it prints, and follow it strictly, step by step. (Human, setting up by hand? See Quickstart.)

You write a model or experiment once as a small program. Demolab runs it, captures everything it produced, stamps it with the exact code version, and publishes a clean page — figures, numbers, and real typeset maths — to both the web and PDF. The numbers on the page are read from the run, so they can't drift. You drive it all by talking to a coding agent; there's no web development or build config to touch.

Quickstart

Open your coding agent in an empty folder and paste:

Run uvx demolab-cli init here, then follow its GETTING-STARTED runbook strictly.

It lays your lab down, walks you through the toolchain (uv, typst) and your first experiment, one step at a time.

Set it up by hand instead?

Install uv and typst (brew install uv typst), then:

mkdir my-lab && cd my-lab
uvx demolab-cli init   # lab structure + git init — yours from the first commit
uv sync                # installs the deps and the `demolab` command

Then write your first experiment — ask your agent to follow GETTING-STARTED, or model one on a shipped reference (demolab docs STARTERS prints the dir; monte-carlo-pi is the canonical starter). demolab dev serves the site as you go. The engine lives in the demolab-cli package — updating it is uv lock --upgrade-package demolab-cli && uv sync.

What to ask your agent

Open your lab in your agent and say a runbook's name — it follows that runbook one step at a time. demolab docs lists them all (each is a plain file shipped in the package; demolab docs <NAME> prints its path). In this repo they live under demolab_cli/runbooks/.

Say… …and it will
GETTING-STARTED set you up end to end: scaffold, your first experiment live on a page, brand, publish
TOUR guided walkthrough of the lab — what's here, what it found, where to start
MIGRATE-CODE bring an existing codebase in, one experiment at a time
FROM-JUPYTER launder a Jupyter notebook into a reproducible, seeded experiment
FROM-PAPER scaffold experiments to reproduce a paper's key result in your stack
MIGRATE-STACK write your tools in MATLAB / Julia / R / Octave instead of Python
EMBED-DOCS drop demolab into another project as a docs/ site
NEXT read your whole arc and propose the next experiments worth running
GROUND-CLAIMS find the source sentences behind each citation
LINT check your writeups against the house style
DOCTOR audit the repo against the conventions
RED-TEAM adversarially check a result holds up before you publish it
STEELMAN build the strongest honest case for a result, so you don't under-sell it
UPDATE update the engine package, leaving your content untouched

How it works

One decoupled loop: a tool computes → drops data → an experiment writes it up → the site publishes it. Every run records its exact parameters and the git commit it came from (stamped on the page), and tables read their numbers straight from the run — so prose and results can't disagree. A single Typst pass emits a website, a PDF per entry, and a book, all sharing the same live numbers.

The detail lives in the guides (in a lab: demolab docs <NAME>; in this repo, the files under demolab_cli/guides/):

  • RULES.md — the tool ↔ experiment contract, schemas, provenance, and how to add things.
  • STRUCTURE.md — the annotated file tree.
  • HOUSESTYLE.md — prose, maths, and figure style.
  • AGENTS.md — the agent entry point.

Commands

demolab shows them all. The everyday ones: init, docs, install, scaffold, dev, build, test. Run an experiment end-to-end directly: uv run python experiments/expNNN.py (there's no demolab run wrapper).

License

MIT — free to use, fork, and adapt for your own lab.

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

demolab_cli-2.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

demolab_cli-2.1.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file demolab_cli-2.1.0.tar.gz.

File metadata

  • Download URL: demolab_cli-2.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for demolab_cli-2.1.0.tar.gz
Algorithm Hash digest
SHA256 dbe6428b02d9354da21a490f61ff6195c79d58fda4391b11467b8f3d6dbc2d5f
MD5 50ab32549ddea4073503b2aa95dd8a2e
BLAKE2b-256 dfb446122dc55de0b120b0205d5c85b7ba9981b4c4d193ad21aed64970d10e47

See more details on using hashes here.

Provenance

The following attestation bundles were made for demolab_cli-2.1.0.tar.gz:

Publisher: publish.yml on eoinmurray/demolab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file demolab_cli-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: demolab_cli-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for demolab_cli-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 181c9eea28d59e4b98ce66fe42caabecacd0ed00a1c96d5ffdbf480548e73d6c
MD5 4d5e957f632acb8eea2d1f73b62dc62a
BLAKE2b-256 8a6c10b5779d47a31e385cde2ba30d31dbe387af1b65d9d5edbb4cbb8961be5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for demolab_cli-2.1.0-py3-none-any.whl:

Publisher: publish.yml on eoinmurray/demolab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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