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.1.tar.gz (7.2 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.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cmdstyler-0.2.1.tar.gz
  • Upload date:
  • Size: 7.2 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.1.tar.gz
Algorithm Hash digest
SHA256 35d4cb4bc034c8402167b5e8bddd5ecca7e8910aab2b83fda54d00eafe971686
MD5 cf99150c061f01adc4d60c9b8f76dbff
BLAKE2b-256 8e5ecd73eb057c683b9cd23df1f6de72977784f06e99b75b46e926e6ce1a95ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cmdstyler-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e7d6264614150eb81b9417331cf36e70c128bf0dc0c0c382cf9a44612aadbc3
MD5 79dd4aa9e23ead041145424ba750d384
BLAKE2b-256 2e596faf4131a00814516b21cdcce4a6e61a170859952fd31dc813ed9828b6e7

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