Skip to main content

Template for backward compatible python libs with registered cli commands

Project description

bitranox_template_py_lib

CI CodeQL License: MIT Open in Codespaces PyPI PyPI - Downloads Code Style: Ruff codecov Maintainability security: bandit

Template for backward compatible (3.9 upwards) python libs with registered cli commands

  • CLI entry point styled with rich-click (rich output + click ergonomics)

Install - recommended via UV

UV - the ultrafast installer - written in Rust (10–20× faster than pip/poetry)

# recommended Install via uv 
pip install --upgrade uv
# Create and activate a virtual environment (optional but recommended)
uv venv
# macOS/Linux
source .venv/bin/activate
# Windows (PowerShell)
.venv\Scripts\Activate.ps1
# install via uv from PyPI
uv pip install bitranox_template_py_lib

Persistent install as CLI tool

# Install latest python
install_latest_python_gcc.sh
# pin uv to the latest python
uv python pin /opt/python-latest/bin/python3
# One-time install (persists from the git repo)
uv tool install --python /opt/python-latest/bin/python3 --from "git+https://github.com/bitranox/bitranox_template_py_lib.git" bitranox-template-py-cli
# or One-time install, persists from PyPi
uv tool install --python /opt/python-latest/bin/python3 bitranox-template-py-cli
# Update (requires network)
uv tool upgrade bitranox-template-py-cli
# Run
bitranox-template-py-cli --help

Persistent install as CLI tool

# install the CLI tool (isolated environment, added to PATH)
uv tool install bitranox_template_py_lib

# upgrade to latest
uv tool upgrade bitranox_template_py_lib

For alternative install paths (pip, pipx, uv, uvx source builds, etc.), see INSTALL.md. All supported methods register both the bitranox_template_py_lib and bitranox-template-py-cli commands on your PATH.

Python 3.9+ Baseline

  • The project targets Python 3.9 and newer.
  • Runtime dependencies: rich-click>=1.9.4 for beautiful CLI output, rtoml>=0.13.0 for fast TOML parsing across all Python versions.
  • Dev dependencies: pytest, ruff, pyright, bandit, build, twine, codecov-cli, pip-audit, textual, and import-linter pinned to their newest majors.
  • CI workflows exercise GitHub's rolling runner images (ubuntu-latest, macos-latest, windows-latest) and cover CPython 3.9 through 3.14.

Usage

The CLI leverages rich-click so help output, validation errors, and prompts render with Rich styling while keeping the familiar click ergonomics. The scaffold keeps a CLI entry point so you can validate packaging flows, but it currently exposes a single informational command while logging features are developed:

bitranox_template_py_lib info
bitranox_template_py_lib hello
bitranox_template_py_lib fail
bitranox_template_py_lib --traceback fail
bitranox-template-py-cli info
python -m bitranox_template_py_lib info
uvx bitranox_template_py_lib info

For library use you can import the documented helpers directly:

import bitranox_template_py_lib as btpc

btpc.emit_greeting()
try:
    btpc.raise_intentional_failure()
except RuntimeError as exc:
    print(f"caught expected failure: {exc}")

btpc.print_info()

Further Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitranox_template_py_lib-1.1.2.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitranox_template_py_lib-1.1.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file bitranox_template_py_lib-1.1.2.tar.gz.

File metadata

  • Download URL: bitranox_template_py_lib-1.1.2.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bitranox_template_py_lib-1.1.2.tar.gz
Algorithm Hash digest
SHA256 e866f4fa3dcef4f50416019adc5231fcf29494132c48cc9d8f37a18040074e12
MD5 534e2af87991614bd67927ccc3144668
BLAKE2b-256 ccf300be4ba3ee896333276676043bbe400da4973232e4a0868281e99edbba22

See more details on using hashes here.

File details

Details for the file bitranox_template_py_lib-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bitranox_template_py_lib-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e51abf0b32f1f54a5c4c4a365f09381554f6df670114f00e421e9da50a14120
MD5 1b9cc0bcdbfde079a2112bfc92e4b6f7
BLAKE2b-256 439d71bccabd2d04355ae436766bf5e7de79cb17f75596adb6e1ff65f4d45dc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page