semvec/pypi-packages huggingface dataset:
textfmt 0.2.1
Terminal Formatting for Humans
License: MIT
Requires Python: >=3.6

# 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:
```sh
pip install textfmt
```

## Usage
Basic Text Formatting
```python
from textformat import TextFormat

print(TextFormat.style("Hello, World!", TextFormat.BOLD, TextFormat.COLORS["blue"]))
```

Custom Word Art Banner

```python
from textformat.word_art import WordArt

print(WordArt.banner("TEXTFORMAT", char="*", width=40))
```

Table Rendering
```python
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))
```

File Download Progress Bars

```python
from textformat.progress import Color, DownloadProgressBar
from pathlib import Path
def download_with_progress(url: str, output_path: Path, download_color, complete_color):
    response = requests.get(url, stream=True)
    total = int(response.headers.get('content-length', 0))

    if response.status_code != 200:
        raise Exception(f"Failed to download from {url}. HTTP status: {response.status_code}")

    progress = DownloadProgressBar(total, prefix=output_path.name, 
                           download_color=download_color, complete_color=complete_color)
    with open(output_path, "wb") as f:
        for chunk in response.iter_content(chunk_size=8192):
            if chunk:
                f.write(chunk)
                progress.update(progress.downloaded + len(chunk))
    print()
    download_with_progress('https://huggingface.co/sharktide/recyclebot0/resolve/main/tf_model.h5', Path("tf_model.h5"), Colors.CYAN, Colors.GREEN)
```
## License

MIT License – Free to use and modify.