Skip to main content

branthebuilder

pypi

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 protocli alone; ruff, pytest and coverage run through uv on demand.
  • Modern Python tooling — uv for dependency management, ruff for formatting and linting, hatchling for builds, pyproject.toml as 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 everything, including uv.lock, and the template branch (vars.TEMPLATE_BRANCH) points at it.

After init the project owns every file except those matching _render.MANAGED (.gitignore and the workflows). branb update-boilerplate re-renders those with the project's current values and layout onto the template branch and commits them there, so a three-way merge keeps the project's own edits to them. --merge stages that merge on the current branch without committing it, for review. A missing template branch starts from the current commit, so its first merge overwrites the managed files and the review is where project-specific lines get restored. 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

# stage template changes to .gitignore and the workflows, then review and commit
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 7.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for branthebuilder 7.0.0
File Size Uploaded Provenance
branthebuilder-7.0.0.tar.gz 15.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for branthebuilder 7.0.0
File Interpreter ABI Platform
branthebuilder-7.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.5 kB

Release files / branthebuilder-7.0.0.tar.gz

Download URL branthebuilder-7.0.0.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cc5d4c05443fb98ec47a8a802a4521be6e4e35d0f8083913fcc0a1bfb75e012e
BLAKE2b-256 checksum
How to use checksums
fd8bfaffe399f182be9b1c4d88695d6e6535d64e95023ef721b1385bc8ef08dd
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-7.0.0-py3-none-any.whl

Download URL branthebuilder-7.0.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49f5ee05660a50dd3b12c4502928211b939d75b8aa1014b4ce6f30bd42ce3cbd
BLAKE2b-256 checksum
How to use checksums
fb37ac2225851605e01b58c3c98040cbce204ae9e23b3e423fb90e0e09a45d70
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 7.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.

Release history Release notifications | RSS feed

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