Skip to main content

A Python module for formatting text with ANSI escape codes.

Project description

fansi_text

A Python module for formatting text with ANSI escape codes.

Installation

pip install fansi_text

Usage

from fansi_text import Red

print(Red("Red text"))
from fansi_text import RGBColor

print(RGBColor("RGB Text", 200, 130, 60))

You can also form complex combinations of overlapping effects.

from fansi_text import *

print(
    Bold("Bold, " +
         Green("green and bold. ")) + 
    "Then normal text. Then " +
    Underline(Overline("under and over lined. ")) +
    "Next " + 
    Italic("italics. Add " + 
           Yellow("yellow " + 
                  Bold("and bold too! ") +
                  "Then back to yellow and italics, ") + 
           "then just italics, ") + 
    "and finally back to normal."
)

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

fansi_text-0.1.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.

fansi_text-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fansi_text-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for fansi_text-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cfbf8be45e4549612a7b6d0e817b78b7c5c3576608008d5fd7594fda8c1c948b
MD5 174183ef0c5a6a359d385675512b3e3a
BLAKE2b-256 2af85b44545b9957ce41b122a2fa5d2ac7378a0825e07e5a32ba32f1cc274978

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fansi_text-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for fansi_text-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79fcf5a41dea3d0b0a13f2f98f920168cc94d69d559258a8261d98e4b2d000bd
MD5 7ec3e18cadf5650a256349a8af0eebc8
BLAKE2b-256 8c57954fda381f147b5c6ba73c8d7d90eb045feb6d0b017829e9119d677cb53c

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