Better CMD text utilities, uses the pdat file format
Project description
cmdstyler
Easily style your CMD/terminal output with headers, colors, and more.
Supports .pdat files for larger projects to keep your code clean.
✨ Features
- ASCII art headers (based on figlet)
- 8-bit text coloring
- Empty line spacing
.pdatfile support (optional)- Background colors
- 24-bit (truecolor) support
- cursor control
Planned:
- Progress bars
- Centered text
📦 Installation
pip install cmdstyler
Usage
How to use cmdstyler:
import cmdstyler as cs
# Print a header, you can specify any figlet font
cs.header("Hello World", "slant")
# Add empty lines
cs.empty(2)
# Print colored text (8-bit)
cs.color("34;This is blue text")
#Print colored text (24-bit or Hex)
cs.rgbcolor("#FFD700", "I am an yellow text!")
cs.rgbcolor((255, 215, 0), "I am an yellow text too!")
#print text with colored background(8-bit)
cs.background(161, "I have a red background!")
#print colored text with colored background(8-bit, first fg, the bg)
cs.bothcolors(161, 19, "I am a red text on a blue background!")
# Load from a .pdat file
cs.beautify("example.pdat")
#cs.cursor
#Cursor functions
# Clears this line
cs.cursor.clear_line()
# Clears the screen
cs.cursor.clear()
# Hides/shows the cursor
cs.cursor.hide()
cs.cursor.show()
# Saves loads cursor position
cs.cursor.save()
cs.cursor.restore()
# Moves the cursor
# Relative movement
cs.cursor.moveby(x, y) #moves the cursor in the x or y direction
cs.cursor.up(y)
cs.cursor.down(y)
cs.cursor.forward(x)
cs.cursor.back(x)
#movement from (0, 0)
cs.cursor.move(x, y)
PDAT file syntax
{header : Hello Guys!}.
# The first word is the function name
# The : separates the function from its argument
# Everything after that is the output
{empty : 2}.
# Creates 2 empty lines
{color : 161 ; This text is red}.
# Prints a colored line with the specified 8-bit color
{textblock : Hallo Welt}.
# Prints a simple line of text
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
cmdstyler-0.2.0.tar.gz
(6.8 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 cmdstyler-0.2.0.tar.gz.
File metadata
- Download URL: cmdstyler-0.2.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c8f499148cee0bcaacfb594b6bfc236085ebef2116091581ef0a87577cff72b
|
|
| MD5 |
8c14882241a3ecc9e251095e06ea6fa3
|
|
| BLAKE2b-256 |
8fc024e7cb14f884ea3aeb7b7b89278e16aec68addb5b7bee24a316e5111f849
|
File details
Details for the file cmdstyler-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cmdstyler-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8e0999ec76b0676f43b242faacfbb5bd47231d00e404e03aac3b1f1d263fe4f
|
|
| MD5 |
8f7da072c9bd032d98dd51d9c541c3f7
|
|
| BLAKE2b-256 |
af746e9bb9e9e19fc379c094d77c48fecdb79fa305adfa5bf28f3273a37fe165
|