A Python library for generating ASCII art from text
Project description
asciigenator
A lightweight Python library for generating ASCII art from text.
Table of Contents
Installation
-
Clone the repository:
git clone https://github.com/bhatishan2003/asciigenator.git cd asciigenator
-
Install the package:
pip install .
-
For development (editable mode):
pip install -e .
Usage
Basic Python Usage
import asciigenator
# Test simple font
print("=== Simple Font ===")
print(asciigenator.generate("Hello", font="simple"))
# === Simple Font ===
# * ** ** *** *** ** *** * *
# * * * * * * * * ** *
# *** * * * * * * ** * * *
# * * * * * * * * * * **
# * * ** ** *** *** ** *** * *
print("\n=== Block Font ===")
print(asciigenator.generate("Ishan", font="block"))
# === Block Font ===
# █
# █ █ ████ ████ █████ █████ ████ █████ █ █
# █ █ █ █ █ █ █ █ ██ █
# █████ ███ █ █ █ █ ██ ████ █ █ █
# █ █ █ █ █ █ █ █ █ █ ██
# █ █ ████ ████ █████ █████ ████ █████ █ █
print("\n=== Available Fonts ===")
print(asciigenator.list_fonts())
# === Available Fonts ===
# ['block', 'simple']
Command Line Usage
asciigenator "Hello World"
asciigenator "Hello World" --font block
asciigenator --list-fonts
asciigenator "Hello World" --font block --border "#"
asciigenator "Hello World" --font block --color magenta
Testing
Run all tests:
pytest -v
Development Notes
-
Pre-commit
We use pre-commit to automate linting of our codebase.
- Install hooks:
pre-commit install - Run Hooks manually (optional):
pre-commit run --all-files
- Install hooks:
-
Ruff:
- Lint and format:
ruff check --fix ruff format
- Lint and format:
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
asciigenator-0.0.2.tar.gz
(7.7 kB
view details)
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 asciigenator-0.0.2.tar.gz.
File metadata
- Download URL: asciigenator-0.0.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b9243c4653e26b50f8ac0807629ad297d45361e3e674aaa5af2aecd05eed0a4
|
|
| MD5 |
ef38a8e3b48a62dfb0c0dbad4f735ca6
|
|
| BLAKE2b-256 |
c8c513a1acef73643f57c4ddb7e1e64fd2ee483b2d4f0e872ee38a0d0e948cb7
|
File details
Details for the file asciigenator-0.0.2-py3-none-any.whl.
File metadata
- Download URL: asciigenator-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44844a13533ae7c67ad33f8b8797fd028cbf6e8330d7aeaa9f7c6376fb74b2cf
|
|
| MD5 |
d7621e2e9b3ba2f69cb51da706994008
|
|
| BLAKE2b-256 |
f1b1f44a1b27c04743d49844b81ca36ac7e84f48fb9b4892a40d096a5de898b3
|