Skip to main content

A small library containing ansi color functions.

Project description

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)

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

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

Uploaded Source

File details

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

File metadata

  • Download URL: AnsiColorsLib-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2aa45fb9022bcab167e94531dae5c88c0381e2b023652cb9b87d153dbded2962
MD5 18320eef801644ad5237c32fbecde8b5
BLAKE2b-256 138df3dde8bce45cf0ba91d186f82a2d54f419036e89e25f06e1da3d1f647bb5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page