branthebuilder
Utility CLI for creating, documenting, testing and releasing Python packages. Projects are rendered from the template bundled in branthebuilder/template/.
Philosophy
This project embodies a self-contained, low-dependency approach to Python library development. Projects built with it follow the same principles.
Core principles
- No external services — no codecov, no readthedocs, no hosted CI artifacts. Everything lives in the repo.
- Docs in the repo — documentation is generated into
docs/as HTML and Markdown, readable by both humans and AI tools without a browser. - Coverage in the repo — test coverage reports are generated locally into
coverage/, in HTML and Markdown formats, committed alongside the code. - Minimal dependencies — avoid heavy frameworks unless the value is clear and lasting. Prefer stdlib, then small focused libraries with few transitive deps. branb itself depends on
protoclialone; ruff, pytest and coverage run throughuvon demand. - Modern Python tooling —
uvfor dependency management,rufffor formatting and linting,hatchlingfor builds,pyproject.tomlas the single config source. - AI-friendly — Markdown output for docs and coverage means both humans and LLMs can read and reason about the project state without fetching external URLs.
Doc generation
API docs are generated from docstrings into docs/api.md using Python's inspect module, run with the project's own interpreter (uv run) so the package imports in its own environment. No external tools required. Release notes live in docs/release_notes.md, with the newest release always on top.
branb build-docs # generates docs/api.md from docstrings
branb tag "msg" minor # prepends entry to docs/release_notes.md
Coverage
pytest-cov + coverage built-in Markdown reporter (coverage ≥ 7.2):
branb test # runs lint + pytest, writes coverage/ with HTML and report.md
Coverage output is committed to the repo so it is always readable in-browser on GitHub and by any LLM with repo access.
Releasing
A release is a pushed tag, never a click on GitHub. branb tag "notes" minor makes one release vX.Y.Z commit holding the bumped __version__, the notes prepended to docs/release_notes.md (when docs/ exists) and the new version and date in CITATION.cff (when it exists). It tags that commit vX.Y.Z with the notes as the message and pushes the branch and the tag atomically. It refuses to start while any of those files has other uncommitted changes, so a release never sweeps in unrelated work.
The tag push runs .github/workflows/release.yml: once the workflow its gate job calls passes, it builds, publishes to PyPI with the PYPI_TOKEN secret and creates the GitHub release from the tag message, with the built dists attached. The gate is test.yml; pointing it at compatibility_test.yml also requires the OS matrix. A push without a tag only runs the tests.
Template
branb init <name> renders branthebuilder/template/, replacing each {{field}} of _render.Context in paths and contents, with the author taken from git config user.name/user.email and the GitHub owner from --github-user or git config github.user. --actions adds the workflows, --os-compatibility the OS matrix, --single-file a module instead of a package. The first commit holds the rendered files only and the template branch points at it; the uv lock lands in a second commit.
branb update-boilerplate re-renders the template with the project's current values and layout onto the template branch and commits it there; --merge merges it into the current branch, otherwise git merge template is yours to run. A file the template no longer produces is listed in _render.RETIRED, which removes it from the template branch, so the merge deletes it from the project unless the project changed it.
Usage
# create a new project from the bundled template
branb init myproject --actions
# lint (ruff format + check)
branb lint
# run tests with coverage
branb test
# build docs
branb build-docs
# tag and push; CI publishes the release once the tests pass
branb tag "release message" minor
# pull template changes into the project
branb update-boilerplate --merge
# citation metadata
branb init-cff
branb add-zenodo-concept-doi 1234567
Installation
uv tool install branthebuilder
branb --complete <args…> prints completion candidates for shell integration (protocli).
License
MIT
Metadata
Release files for branthebuilder 6.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| branthebuilder-6.0.0.tar.gz | 14.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| branthebuilder-6.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.5 kB
Release files / branthebuilder-6.0.0.tar.gz
| Download URL | branthebuilder-6.0.0.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6ea4e5f9732dd479a14a9eb1ca7bc8fdf69fbe85db75c4b76a6f3ad62e24d18
|
|
BLAKE2b-256 checksum How to use checksums |
c0c18847fe3205f3f669e78b25ec194e56ce10c2c795e505dc7b120903c40cfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.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}
|
Release files / branthebuilder-6.0.0-py3-none-any.whl
| Download URL | branthebuilder-6.0.0-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04f78123dea1add9c6e8fb552d4821a7b69e221412f49eaf8892cc152736f9f9
|
|
BLAKE2b-256 checksum How to use checksums |
620817d7b13ae666ab2e8cbb26df91d83d6c1791464b033ffa3b3049512b01b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.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}
|
Security for branthebuilder 6.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.