Skip to main content

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
  • .pdat file support (optional)
  • Background colors
  • 24-bit (truecolor) support
  • cursor control
  • Centered text

Planned:

  • Progress bars
  • layout control

📦 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")

# Print a centered text
cs.center("I am centered!")

# 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.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

cmdstyler-0.2.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file cmdstyler-0.2.2.tar.gz.

File metadata

  • Download URL: cmdstyler-0.2.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for cmdstyler-0.2.2.tar.gz
Algorithm Hash digest
SHA256 f3cd370dd77f08e3e25c73c46aa4bf65b2518c9e7428a5f35d511249bcf25a18
MD5 05cba06c3b2c7174e95870d4bb6bc1f5
BLAKE2b-256 051cb91145f0f4cc4c104e1854d06cdd13dfb15b23d07fbe0b201ae86704b441

See more details on using hashes here.

File details

Details for the file cmdstyler-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: cmdstyler-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for cmdstyler-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c70458d290afe1b4704b4b7d3140cc54ecd45334dca8464eb92d6b92d31af61
MD5 d581d87c3f00bf7429bf578ef276b664
BLAKE2b-256 65f25a37930027deb61e33413c4e2667c9e8838effbd8e188382007b8966d46b

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