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-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

textura-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for textura-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0cc74b11c30bee0551ad3e0604a4fcd4e39a681fcfdf68a7296c171ecd7eb33d
MD5 9871ba105487d5f937c82a495e7f0631
BLAKE2b-256 0c40661a8186e90cd0139abe9e02321cb2a8b2b7bb83859be7a8666ce398d19e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for textura-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8acb003b4f928c04a3bb993d996b6f33130927d8bb56f4e6b801131b67f73e56
MD5 e5e13db1bfc64a38717052a942977000
BLAKE2b-256 a6928e01492e59f72affc5d1d07db32fa32863dfc7607fb493143fd53f725c7f

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