Metadata-Version: 2.4
Name: textfmt
Version: 0.2.1
Summary: Terminal Formatting for Humans
Author-email: Rihaan Meher <meherrihaan@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/sharktide/textformat
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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.
