Skip to main content

A Python module for ANSI text formatting, word art, and table styling

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.1.1.tar.gz (3.4 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.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for textfmt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7ea300e0491ac2dfdab30714fa7476ee81eba741a5e09e1757e349a728ee7160
MD5 3ceb171bcdce782e0a0d80dc1a748108
BLAKE2b-256 07342cc311cfdd50e3673f8d022b3707956f850fcdd8ac1c845a41a6b8774b48

See more details on using hashes here.

File details

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

File metadata

  • Download URL: textfmt-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0794f44aacb9eecf63b8df7c6cb20d953a131fb020d4fff9c89e00737f5c897
MD5 2c9fb71a03b59f219050ef0b071cdb52
BLAKE2b-256 16cb302c1ccbe134e34490df2647657f078eddbb5a4ac808cd2ab3a31b4c0652

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