Skip to main content

AnsiColorsLib

This is a library that is designed to allow developers to easily print colorized text.

Installation

To install simply use pip:

pip install AnsiColorsLib

Usage

from ansicolorslib import COLOR_MANAGER

# Print entire text with a modification.
COLOR_MANAGER.ansiprint("Hello, World!", COLOR_MANAGER.RED + COLOR_MANAGER.BOLD, begins_with="\t\t", ends_with="\n\n")


# Modify a specific part of a string.
START_INDEX = 3
STOP_INDEX = 9
MOD = COLOR_MANAGER.GREEN + COLOR_MANAGER.BOLD
param1 = (START_INDEX, STOP_INDEX, MOD)

modded = COLOR_MANAGER.modify_string("Hello, World!", [param1])
print(modded)


# Get ansi string of rgb value.
R = 123
G = 221
B = 111

my_ansi = COLOR_MANAGER.ansirgb(R, G, B)
COLOR_MANAGER.ansiprint("Hello, World!", my_ansi)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AnsiColorsLib-1.0.3.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file AnsiColorsLib-1.0.3.tar.gz.

File metadata

  • Download URL: AnsiColorsLib-1.0.3.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for AnsiColorsLib-1.0.3.tar.gz
Algorithm Hash digest
SHA256 968a8c599ef6d635ff2879dd578b8f099854f01b18f8dc9acb6fee2964f24a87
MD5 0f8f10c8afc0366ab5c8dd2b85ca25cd
BLAKE2b-256 f3d4652ef51147e966ffe043babea729c7897d440f978efe0d823e117ba8fdab

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 file

1.0.2

1 file

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page