Skip to main content

bannerforge

PyPI version License

Colorful terminal banners. One line, one print, done.

██╗  ██╗███████╗██╗     ██╗      ██████╗
██║  ██║██╔════╝██║     ██║     ██╔═══██╗
███████║█████╗  ██║     ██║     ██║   ██║
██╔══██║██╔══╝  ██║     ██║     ██║   ██║
██║  ██║███████╗███████╗███████╗╚██████╔╝
╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝ ╚═════╝
                                      World

install

pip install bannerforge

usage

from bannerforge import banner

banner("HELLO", "World")

That's it. No print(), no assignment, no ceremony. The banner renders on its own.

explicit rendering

If you need deterministic timing — tests, CI, precise control — call .render() explicitly:

banner("HELLO", "World").render()

This bypasses the __del__ magic and prints immediately. Once rendered, the object won't render again.

rendering to a string

If you need the banner as a string instead of printed output:

output = banner("HELLO", "World").to_string()
print(output)

alignment

banner("HELLO", "World").left()
banner("HELLO", "World").right()
banner("HELLO", "World").center()

Only the subtitle moves. The main text is always centered.

custom colors

By default a random color pair is picked each call. To pin them:

banner("HELLO", "World").colors("cyan", "yellow").render()

Valid colors are the same ones cfonts accepts: black, red, green, yellow, blue, magenta, cyan, white, gray, and their bold* variants (e.g. boldred).

no subtitle

banner("HELLO")

error handling

If rendering fails, bannerforge raises an exception and prints a clear message to stderr. You can catch it if you want:

try:
    banner("").render()
except ValueError as e:
    print(f"caught: {e}")

The __del__ fallback swallows errors silently (to avoid interpreter shutdown crashes), so for reliable error reporting always use .render().

how it works

The banner object normally renders itself in __del__. When you don't bind the return value, Python drops the reference immediately and the banner prints. If you do bind it, the banner waits until the variable goes out of scope.

# prints immediately
banner("HELLO", "World")

# prints when x goes out of scope / program ends
x = banner("HELLO", "World")

For predictable behavior, prefer .render(). It makes the output timing explicit and surfaces any rendering errors.

license

Custom Attribution License — see LICENSE.

You can use, modify, and redistribute this code freely. If you do, you must credit Himanta Bhuyan and link back to this repository.

author

Himanta Bhuyan — @realximanta

Metadata

Release files for bannerforge 0.3.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 bannerforge 0.3.0
File Size Uploaded
bannerforge-0.3.0.tar.gz 5.1 kB Details

Built distribution (wheel)

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

Total release size: 10.5 kB

Release files / bannerforge-0.3.0.tar.gz

Download URL bannerforge-0.3.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
40115be82982763a9472e71a6a0a06e1d313d983ec5a262dc8414d0acf8fff1a
BLAKE2b-256 checksum
How to use checksums
d8f7d2a666a43d171c010ded4a1029b08d9f37ed50907f20fc49f6164dd47256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / bannerforge-0.3.0-py3-none-any.whl

Download URL bannerforge-0.3.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f9a037a0cbc4fda421e0db65d0818f501af2add4546fbc6e99f322597f2b719
BLAKE2b-256 checksum
How to use checksums
a4069cb77b50174f27f28c2a3864835f6c402ff77dbdb61aef268b803a5deeb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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