A lightweight terminal styling helper with ANSI colors, cursor movement, and ASCII art helpers.
Project description
stylizedterminal
stylizedterminal is a lightweight Python package for adding terminal styling to text using ANSI escape codes. It provides helpers for colors, background colors, bold/italic/underline/strikethrough text, cursor movement, screen clearing, and simple ASCII art.
Installation
Install the package from PyPI:
pip install stylizedterminal
Importing the package
import stylizedterminal
from stylizedterminal import StylizedStr
Usage
Text colors
from stylizedterminal import StylizedStr
print(StylizedStr("Hello").color("red"))
print(StylizedStr("Hello").color("green"))
Background colors
from stylizedterminal import StylizedStr
print(StylizedStr("Hello").background_color("blue"))
Text styles
from stylizedterminal import StylizedStr
print(StylizedStr("Hello").bold())
print(StylizedStr("Hello").italic())
print(StylizedStr("Hello").underline())
print(StylizedStr("Hello").strikethrough())
Cursor movement and screen clearing
from stylizedterminal import StylizedStr, move_cursor, clear_screen
print(StylizedStr("Hello").move_cursor(r, 5)) # The first parameter is the direction, the second parameter is by how much.
clear_screen()
ASCII art
from stylizedterminal import StylizedStr
print(StylizedStr("HELLO").ascii_art()) # if you also want to make it something else for example a different color you will have to call the ascii_art() function first, else it will get confused and print the color code in the ascii.
Development
If you want to work on the package locally:
git clone <your-repo-url>
cd stylizedterminal
python -m venv .venv
source .venv/bin/activate
pip install -e .
Run the tests with:
python -m unittest discover -s tests -v
Project structure
src/stylizedterminal/contains the package source codetests/contains the test suitepyproject.tomldefines packaging metadata
Project details
Release history Release notifications | RSS feed
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 stylizedterminal-0.2.0.tar.gz.
File metadata
- Download URL: stylizedterminal-0.2.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c04d8c4d2168e7d46867075df28db551e3d901859980791fc872560b5625281f
|
|
| MD5 |
3d3a8da5c4604dd7f71e8e0097d667c6
|
|
| BLAKE2b-256 |
3206b3e5d1d688b5831d2c171aa70e05d49675b4f2b8b8984b368b7cd4c860f0
|
File details
Details for the file stylizedterminal-0.2.0-py3-none-any.whl.
File metadata
- Download URL: stylizedterminal-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d01a555b8060d9b406d6f8c5a028c99515d67e1daba2c861636318dbff2881ae
|
|
| MD5 |
56f84337dedd88ba099a5aa6a19f3678
|
|
| BLAKE2b-256 |
84a4774c67ed165f8a0a58623dc45713a173756673badf284fca81817b8f4e0c
|