Skip to main content

A Python module for terminal text styling without the overhead of rich

Project description

TextFormat

TextFormat is a lightweight Python module for ANSI text formatting, customizable word art, and table rendering in CLI applications.

Features

  • ANSI Colors & Styles – Easily format text using intuitive color mappings.
  • Customizable Word Art – Generate banners with adjustable characters and widths.
  • Table Formatting – Display structured data in a clean, readable format.

Installation

Install via PyPI:

pip install textfmt

Usage

Basic Text Formatting

from textformat import TextFormat

print(TextFormat.style("Hello, World!", TextFormat.BOLD, TextFormat.COLORS["blue"]))

Custom Word Art Banner

from textformat.word_art import WordArt

print(WordArt.banner("TEXTFORMAT", char="*", width=40))

Table Rendering

from textformat.table import TableFormatter

headers = ["Feature", "Color", "Effect"]
data = [
    ["Bold", "White", "Strong emphasis"],
    ["Underline", "Blue", "Text decoration"],
    ["Warning", "Yellow", "Cautionary message"],
]

print(TableFormatter.generate(headers, data))

License

MIT License – Free to use and modify.

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

textfmt-0.2.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

textfmt-0.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file textfmt-0.2.0.tar.gz.

File metadata

  • Download URL: textfmt-0.2.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for textfmt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 71fb499bfa7f1463924f6523056cec9bddf2e877acfb974699899dc823de2ea5
MD5 5247ff6a8d740f462402669cb4f5f400
BLAKE2b-256 2af1ec43c4e31b3e6783635c2cf29fb97794bcaf4d420c08fb6dd520fc0e2535

See more details on using hashes here.

File details

Details for the file textfmt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: textfmt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for textfmt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76d867a4f73cbbe27f837250e746971a090c26a3dbecded3f94f887770cc4fd6
MD5 55c4ded02504943447fcd03d0f30a77d
BLAKE2b-256 e41aeede4b96bbe9ec5fb02b5c365b4234c554d317a13c005678695b4d2a2207

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