Skip to main content

Terminal text styling made simple, like colorama but cooler.

Project description

Textura

Textura is a Python package for terminal text styling, similar to colorama, but with more features and flexibility. With Textura, you can easily add foreground colors, background colors, and text styles (bold, italic, underline) to your terminal output.

Installation

You can install Textura using pip:

pip install textura

Usage

Here is an example usage

import textura
from textura import Fore, Back, Style, txtra_print, txtra_format, option, colors_list, PrintError

# Set options (reset text at end, and prevent styled text in print())
option(resetend=True, strict=True)

# Display available colors and styles
print("Available styles and colors:")
colors_list()

print("\n--- Styled Print Examples ---\n")

# Foreground color example
txtra_print("{Fore.GREEN}Green text")

# Background color example
txtra_print("{Back.YELLOW}{Fore.BLACK}Black on yellow")

# Style example
txtra_print("{Style.BOLD}Bold text")
txtra_print("{Style.UNDERLINE}Underlined text")
txtra_print("{Style.ITALIC}Italic text")

# Combined styles
txtra_print("{Back.RED}{Fore.WHITE}{Style.BOLD}Bold white on red background")

# Using txtra_format to return a styled string
formatted = txtra_format("{Fore.LIGHTBLUE}{Style.UNDERLINE}Underlined Light Blue")
print(formatted)  # This works fine

# Incorrect usage: using styled text directly with print (strict=True will raise PrintError)
try:
    print("{Fore.RED}This should raise an error if strict=True")
except PrintError as e:
    print(f"Caught PrintError: {e}")

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

textura-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

textura-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file textura-0.1.0.tar.gz.

File metadata

  • Download URL: textura-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for textura-0.1.0.tar.gz
Algorithm Hash digest
SHA256 798151453a2afe4786be853cdbfd5f3f0ec1e54baaff592d7dab33c9aebd2b80
MD5 6fe5a8afed32cab12189056ae7ce02e5
BLAKE2b-256 13150776099377e86fd14b6fc6d98b5d17a6912495e28d8389fad362e89cce7b

See more details on using hashes here.

File details

Details for the file textura-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: textura-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for textura-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cc2882d4a67442a041d76272fb14d6b73b2ffcc1273833225d6326134b7d168
MD5 24ebad57575080a43771d07db460ac96
BLAKE2b-256 b1ea98daf3adafc2370cee6e51c97ed5f173fcf33a690561c2df6eb302258944

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