Skip to main content

Printly is a Python library that enhances the built-in print function with direct text styling: foreground color, background color, and font styles.

Project description

Printly

Printly is a Python library that enhances the built-in print function with direct text styling: foreground color (fg), background color (bg), and font styles (fs).

Features

  • Colors:
    • Supports over 140 color names (from HTML)
    • Supports all RGB values (e.g., "128,0,128")
    • Supports all HEX color codes (e.g., "#ff00ff")
  • Font Styles:
    • Supports 7 font styles: bold, italic, strikethrough, underline, overline, double-underline, and hide.
    • Supports combining multiple font styles (e.g., "bold+italic")
  • Compatibility:
    • Supports all standard print() parameters: sep, end, file, and flush.

Installation

pip install printly

Usage

1. print() Function

An enhanced version of the built-in print() function.

Example 1 (Recommended)

import printly
printly.print("Hello, world!", fg="red", bg="white", fs="bold") 

Example 2 (Override Built-in print())

from printly import print
print("Hello, world!", fg="red", bg="white", fs="bold")

2. style() Function

Apply foreground color, background color, and font style to text.

Example

from printly import style
styled_text = style("Hello, world!", fg="red", bg="white", fs="bold")
print(styled_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

printly-0.3.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

printly-0.3.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file printly-0.3.0.tar.gz.

File metadata

  • Download URL: printly-0.3.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for printly-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fc0ab4957a3fe250c4709c26bfc6509f88774ca6914ddb874781f03322e066ee
MD5 c0365d69ccf1f14325506d40e0f24496
BLAKE2b-256 abf4b3bbf39d7000068a1b9b183bfd4db40b45956b3b6c5a7c3176866fab9132

See more details on using hashes here.

File details

Details for the file printly-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: printly-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for printly-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3351bdc8f0b0285453be40bad26e5fc3ecc9e65d355ac0d65adc2fb96f1f3de1
MD5 98b9116f4abac5fbf034870b7e9b419b
BLAKE2b-256 cde6335192d29e1d9edca8b0725fdd420b516914b105f1881c53e9de74bb711a

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