Skip to main content

A Python library for generating ASCII art from text

Project description

asciigenator

A lightweight Python library for generating ASCII art from text.

PyPI version Python Versions License Python application Coverage

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
      
  • Ruff:

    • Lint and format:
      ruff check --fix
      ruff 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.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asciigenator-0.0.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file asciigenator-0.0.1.tar.gz.

File metadata

  • Download URL: asciigenator-0.0.1.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

Hashes for asciigenator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4c3a40ca85dbca19454f1406a6d10041c550066db50bc8093abe25da07387fcf
MD5 4c1167fc6a0d0094c2ab6a573b97e803
BLAKE2b-256 5a92039f2d919137f1c46371b70caa1c7e7632564367f1e067b00be48a7972c6

See more details on using hashes here.

File details

Details for the file asciigenator-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: asciigenator-0.0.1-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

Hashes for asciigenator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6fd5d7f7022e84141dd1dbbb3c4c7a4104eb535ed70859d0bc23dafeb43aa517
MD5 95e1c8bc282e78ccf90c9ad525f2946d
BLAKE2b-256 81c42168664d87d5f18e03b9963eb7077bc8b26125a6f1645b7e15545c542ad6

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