A Python module for ANSI text formatting, word art, and table styling
Project description
textfmt
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 textformat
Usage
Basic Text Formatting
import textfmt
print(textfmt.TextFmt.style("Hello, World!", textfmt.TextFmt.BOLD, textfmt.TextFmt.COLORS["blue"]))
Custom Word Art Banner
import textfmt.word_art
print(textfmt.word_art.WordArt.banner("TEXTFMT", char="*", width=40))
Table Rendering
import textfmt.table
headers = ["Name", "Color", "Effect"]
data = [
["Bold", "White", "Strong emphasis"],
["Underline", "Blue", "Text decoration"],
["Warning", "Yellow", "Cautionary message"],
]
print(textfmt.table.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textfmt-0.1.0.tar.gz.
File metadata
- Download URL: textfmt-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53923503a817031d93d026aaaea58213ed7bfc5b7a6a978cec6bc75e1c689722
|
|
| MD5 |
41479b26ff7681be72376290a8d57718
|
|
| BLAKE2b-256 |
a9f48b5cc2d390839f977550dfc7fcba4318de6b86d3be8f02676afc5382350c
|
File details
Details for the file textfmt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: textfmt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2408e589f474bb93f772683c4c0f44f36b204474d27a624630a2d23fd5db003
|
|
| MD5 |
6bb7e034f4c840bf1b25ed4303e1b574
|
|
| BLAKE2b-256 |
eac410b9d3d4938bcc671b086a76566ca08719128577d3dabd509a886d0de663
|