Skip to content

API Reference#

The API reference is generated from the packages' docstrings: one page per module, arranged in the site's left navigation as a tree that mirrors the package. Expand API Reference in the sidebar, then a package, then a subpackage, the way you would in a file explorer. A module's page shows the module's docstring followed by its public members — classes, functions, constants — each with its own docstring, and a package's index page is its __init__ docstring, which states the package's mental model in a few numbered steps. Those index pages are the best place to start reading.

There is one tree per library package — the three packages a study imports. The server and the sync tool are command-line programs, documented as prose under Running a Server and Syncing Data, not here.

  • capturegraph — import capturegraph as cg, the core package and the standard the other platforms implement. It holds the type system and the procedure recorder (Defining Procedures); cg.scratch, the cache that memoizes analysis functions by the content hash of their inputs (Caching and the Scratch); and cg.logging (Logging and Progress). One sub-surface is imported on its own rather than through cg: capturegraph.api_models (import capturegraph.api_models), the wire shapes of the captured-data file API — the contract between the server, which produces the responses, and the sync tool, which consumes them (The Captured-Data Format).
  • capturegraph_ui — import capturegraph_ui as cgui, the pages package: Page and PageBuilder, the components, viewers and charts a page is built from, and Notebook, the log sink that renders a cg.logging log as HTML in a Jupyter cell (Pages).
  • capturegraph_recipes — import capturegraph_recipes as cgr, the analysis package. sfm, depth and splats take a capture's photographs to a 3D reconstruction — solved cameras and sparse points, a learned depth map per image, and a trained Gaussian splat (Reconstruction); gpu runs the depth and splat stages' driver scripts in a separate interpreter, the one CG_GPU_PYTHON names, where torch and the model packages live; and capturegraph_recipes.scheduling decides when and where the next capture is worth taking (Scheduling Captures). The types these recipes produce (cgr.Reconstruction, cgr.Splat, …) are analysis-only: a recipe makes them and a procedure never captures one, so they live here rather than in the core.

Each package's index page lists every module; the bullets above say what each package is for. How the three layer, and how a package of your own joins them: Extending CaptureGraph.

Maintaining the reference

The pages and the sidebar entries are generated and committed: run uv run python scripts/gen-api-reference.py after adding, removing, or moving a module. CI runs it with --check before the build, so they cannot drift. To give a package of your own a tree, add it to the script's list — Packaging an Extension.