Create a Python module
Keep your calculation small and expose explicit, versioned inputs and outputs.
Custom functions and package blocks
Use the developer guide for typed module manifests, source/package layout, settings, workflow bundles, Python execution and authenticated catalog publication. The original SDK templates below remain supported.
Scaffold and run
Run these commands from an installed checkout. The generated module includes a function, manifest, synthetic input and behavior test. Use a new output filename for each run.
Inspect the saved JSON output with your editor or python -m json.tool result.json. Local Python executes with your user permissions. Only run code you trust.
uv run hb init my-analysis
uv run hb validate my-analysis
uv run python -m pytest my-analysis/test_main.py -q
uv run hb run my-analysis --input my-analysis/sample.json --output result.jsonWork with any file format
Declare named input/output ports and read files with your own installed libraries. A new format does not require a core platform parser. The runner records accepted files, hashes, sizes and declared metadata.
The file runner publishes a new result directory containing result.json and the declared files. It preserves bytes; your module must validate content, units, calibration and scientific compatibility.
uv run hb init my-file-analysis --template files
uv run hb validate my-file-analysis
uv run python -m pytest my-file-analysis/test_main.py -q
uv run hb run my-file-analysis --input my-file-analysis/inputs.json --output new-resultVersion the scientific contract
Do not install dependencies dynamically inside a patient job or the API. Runs execute on your organization’s enrolled machines from a pinned snapshot; container isolation for shared machines is future work.
- Declare semantic contract versions, units, time bases and missing-value behavior.
- Use synthetic known-answer cases and invalid-input tests; do not silently change algorithms or units.
- Pin dependencies through a reviewed runtime profile. Specialized dependencies need an appropriate reviewed image or native adapter.
- Create new outputs for reanalysis. Preserve original evidence and historical contract versions.
Publish a module or metric from GitHub
Keep the code in GitHub and publish a pinned version to your organization’s module library. The file must be committed and pushed. The published code names its repository, commit and path, and pipelines run that exact copy, never a later push.
uv run --frozen hb agent login
uv run --frozen hb block publish module.json --code module.py --organization ORG --study PROJECT
uv run --frozen hb metric publish my_metric.py --organization ORG --study PROJECT