bitranox_template_py_lib
A scaffold for backward-compatible (Python 3.10+) libraries that ship a registered CLI command, with a rich-click entry point, strict typing, and a full test-and-release pipeline already wired.
Why a template
Starting a new Python library feels like it should be about the library. It almost never is. The first day goes on the scaffolding nobody brags about: which linter, which type checker, how the version number stays in step across three files, how a tag becomes a PyPI release, which Python versions you have quietly promised to keep working. None of that is the thing you set out to build, and all of it has to be right before the thing you set out to build can ship.
The tax on that work is invisible, which is exactly why people underprice it. A blank directory looks free. It is not. It is a stack of small decisions you will make in a hurry, slightly wrong, and then copy by hand into the next project, where you will make them slightly wrong again. A blank page is not a fresh start so much as a bill you have agreed to pay later.
A template is the boring answer that settles the bill up front. You inherit a working set of
defaults, tests green across five Python versions and three operating systems, strict typing, a
lint/type/test/release pipeline behind a single make command, a CLI that already runs, so the
only decisions left are the ones that are actually about your library. The point is not that
these are the only good choices. The point is that they are already made and already wired
together, so you get to disagree with one on purpose rather than rediscover all of them by
accident.
So clone it, delete the parts you do not want, and spend day one on the problem you actually care about. That is the whole trick: make the sensible path the lazy one.
Quickstart
1. Start a new library from this template
The first thing you do is copy the template into a new directory named for your package, rename it to that package, and reset the git history to one fresh commit. The directory name drives the rename, so name it for your library first.
# copy the template into a new dir named for your package
git clone --depth 1 https://github.com/bitranox/bitranox_template_py_lib.git lib_wombat
cd lib_wombat
git remote remove origin # detach from the template so nothing ever pushes back to it
git branch -m master main # new repos use main, not master
# rename the project to your package (rename-project, run via uvx)
./rename_dry.sh # preview: rename-project --dry-run. Confirm every detected
# name and path reads "lib_wombat" before applying.
./rename.sh # apply: rename-project --yes. Takes NO argument - the new name
# comes from the directory, so `./rename.sh lib_wombat` is wrong.
# squash the template history into a single fresh commit
./reset_git_history.sh # with the remote removed above, this rewrites local history only
Now create your own empty GitHub repo, add it as origin, and push main. Removing the template
remote first matters: reset_git_history.sh force-pushes to the first remote it finds, and right
after a clone that would be the template itself.
See docs/development.md for the full develop-test-release flow (bmk).
2. Try the CLI and API
To see what you get, install the template's own package from PyPI (uv recommended, plain pip
works too):
uv pip install bitranox_template_py_lib
Run the CLI:
bitranox_template_py_lib hello # -> Hello World
bitranox_template_py_lib info # print resolved package metadata
bitranox_template_py_lib --help
Or run it without installing:
uvx bitranox_template_py_lib hello
python -m bitranox_template_py_lib hello
Use it as a library:
import bitranox_template_py_lib as lib
lib.emit_greeting() # writes "Hello World" to stdout
lib.print_info() # print the package metadata block
See docs/usage.md for the full command and API reference.
Documentation
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bitranox_template_py_lib-2.0.0.tar.gz.
File metadata
- Download URL: bitranox_template_py_lib-2.0.0.tar.gz
- Upload date:
- Size: 56.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d62d7232f9f7bfcffc9689d8e2d91ea2679814a386fdcf2262ea0ebdb95dbf72
|
|
| MD5 |
e783bcf34ec22126b148b09ccbc45ddf
|
|
| BLAKE2b-256 |
c165e791a977755bb6b01b226ec036b77e6e36b4dbf316ee79abafb9128ee56f
|
File details
Details for the file bitranox_template_py_lib-2.0.0-py3-none-any.whl.
File metadata
- Download URL: bitranox_template_py_lib-2.0.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5244cc65e2f854f4e8c5ea745c866fa0040331e35ddb2288f9204ff5ac4d7e1b
|
|
| MD5 |
930b72c155afb9c3c4fd5c1f51903e8e
|
|
| BLAKE2b-256 |
34ddbea5f6e58dd45ff4f2535b943ef7301229c8b4624bf72d50f58c83c73840
|