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.2.1.tar.gz (9.4 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.2.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for printly-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3da7a41bf6da099afb354f8cb4c5e938a78f29730d0ae5bc8cfcb559fab5546d
MD5 f1bb1f9eb54d00259fc178cb14e81262
BLAKE2b-256 8c497b1de35e984c6e500e4c5e6c0a53efb70f7eb0ec2441305e8b6df465ca64

See more details on using hashes here.

File details

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

File metadata

  • Download URL: printly-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4426082feac4d03a033268db05c7e92ae5d22a31809b960f4bfd723519ef93c4
MD5 b7dff5dda857d190ddb840054a1fb263
BLAKE2b-256 46205982b15aa760ddc6b265fd805a81510948ec6227ae3359683c0f30928d82

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