Skip to main content

ANSI Formatter - Python Package

Description: A lightweight Python package for text formatting using ANSI escape codes. Provides colored text, text styles, and basic terminal control.

Installation: pip install ansiformatter

Basic Usage: from ansiformatter import ANSIFormatter, RED, BOLD

f = ANSIFormatter() print(f.format("Error", RED, BOLD)) print(f.red("Red text")) print(f.bold("Bold text"))

Available Styles: Text styles: BOLD, DIM, ITALIC, UNDERLINE, BLINK, REVERSE, HIDDEN, RESET Text colors: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE Background colors: BG_BLACK, BG_RED, BG_GREEN, BG_YELLOW, BG_BLUE, BG_MAGENTA, BG_CYAN, BG_WHITE

Examples:

Colorful output

print(f.red("Error: ") + f.yellow("Warning"))

Status message

status = f.green("✓ Success") if success else f.red("✗ Failed")

Combined styles

print(f.format("Important", BOLD, UNDERLINE))

Utilities: from ansiformatter import is_ansi_supported, strip_ansi_codes

Check ANSI support

if is_ansi_supported(): print(f.green("Terminal supports ANSI"))

Remove ANSI codes

clean_text = strip_ansi_codes(formatted_text)

Notes:

  1. Not all terminals support all ANSI features
  2. For Windows, may need to enable ANSI support
  3. Basic 8-color system only

License: MIT

Metadata

Release files for ansiformatter 0.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 ansiformatter 0.1.0
File Size Uploaded Provenance Actions
ansiformatter-0.1.0.tar.gz 183.1 kB Without provenance Details for ansiformatter-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ansiformatter 0.1.0
File Interpreter ABI Platform Actions
ansiformatter-0.1.0-cp312-cp312-manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details for ansiformatter-0.1.0-cp312-cp312-manylinux2014_aarch64.whl

Total release size: 379.9 kB

Release files / ansiformatter-0.1.0.tar.gz

Download URL ansiformatter-0.1.0.tar.gz
Size 183.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6c4d04f48aff14866b61667e615d3c64d94fb9132ac7bff294a2a2626d0456c7
BLAKE2b-256 checksum
How to use checksums
8b61784aa507cf11ca2afa8a9ca420fd3a77840baa21d1ba610b69b742ea9fd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / ansiformatter-0.1.0-cp312-cp312-manylinux2014_aarch64.whl

Download URL ansiformatter-0.1.0-cp312-cp312-manylinux2014_aarch64.whl
Size 196.8 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
af4258c0c0a4ccc35a2749b67484c3ed212c42bd2914dfcd2a9eaf6b09c42d30
BLAKE2b-256 checksum
How to use checksums
a6904d777a3329c7c90828986365edd4d306e9959ff92b383f3a1db6f25090b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for ansiformatter 0.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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