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, in a temporary worktree that leaves uncommitted work alone, 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.

Developing against local checkouts

branb link ../atqo ../dirark makes the project import those checkouts instead of the installed releases, without a [tool.uv.sources] path in pyproject.toml, so the repo and CI keep resolving dependencies from PyPI. It writes vars.LINK_PTH into the project's venv, which uv neither manages nor removes. The file prepends each checkout (its src/ when it has one) to sys.path, and every uv run keeps it, including branb test. A new link set replaces the old one, branb link alone removes it, and recreating the venv drops it. Linking shadows the installed release rather than installing the checkout: a dependency the checkout adds is missing until it is released, and a requirement on an unreleased version still fails to lock.

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

# import sibling checkouts instead of their releases; no paths unlinks
branb link ../atqo ../dirark
branb link

# 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.1.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.1.0
File Size Uploaded Provenance
branthebuilder-7.1.0.tar.gz 16.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 35.7 kB

Release files / branthebuilder-7.1.0.tar.gz

Download URL branthebuilder-7.1.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fa956b0a7ef37c9cd71916d4c650b558999cd41fbef8d4f60b4d8c729fe97888
BLAKE2b-256 checksum
How to use checksums
5c9fd0388dd09600714d14807a09469f9df8ae749fb60d4772d375167efd1f3c
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.1.0-py3-none-any.whl

Download URL branthebuilder-7.1.0-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8937df622fb72eb9841c9eefdd31690d30bece46a0e68cba5ff93bac9208d0f7
BLAKE2b-256 checksum
How to use checksums
ef3db9dbd304750fe8acf27afd9ea302e2afc8c1f197da9075ad3a7195fbbb68
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.1.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