Skip to main content

Simple python library for color and formatting to terminal

Project description

Latest Release pipeline status coverage report Python Code style: flake8 Type checked: mypy Linting: pylint License: MIT

About

Colored, it's a simple Python library for color and formatting in terminal. Collection of color codes and names for 256 color terminal setups. Colored now supports RGB color mode. As "true color" graphic cards with 16 to 24 bits of color became common, applications began to support 24-bit colors. Terminal emulators supporting setting 24-bit foreground and background colors with escape sequences include Xterm, KDE's Konsole, and iTerm, as well as all libvte based terminals, including GNOME Terminal.

The colors work with most terminals and terminals emulators. ANSI/VT100 escape sequences can be used in every programming languages.

Colored is powerful and easy to use:

>>> from colored import Fore, Back, Style
>>>
>>> Fore.red
'\x1b[38;5;1m'
>>>
>>> Back.red
'\x1b[48;5;1m'
>>>
>>> Style.reset
'\x1b[0m'
>>> 
>>> Fore.rgb('100%', '50%', '30%')
'\x1b[38;2;255;130;79m'
>>>
>>> print(f'{Fore.white}{Back.green}Colored is Awesome!!!{Style.reset}')

!!! success

>>> Colored is Awesome!!!

Installing

Open up a terminal and install colored with pip command:

$ pip install colored

Alternatively, you can grab the latest source code from GitLab:

$ git clone https://gitlab.com/dslackw/colored.git
$ cd colored
$ pip install .

Usage

The User Guide is the place to go to learn how to use the library.

The API Reference documentation provides API-level documentation.

License

colored is made available under the MIT License. For more details, see here.

Contributing

!!! info We happily welcome contributions!

Donate

Did you know that we developers love coffee?

paypal

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

colored-2.3.2.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

colored-2.3.2-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file colored-2.3.2.tar.gz.

File metadata

  • Download URL: colored-2.3.2.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.33.0

File hashes

Hashes for colored-2.3.2.tar.gz
Algorithm Hash digest
SHA256 d6b7f0737a732c54c92b271f2932c91e386238c8b6ded49d4180eed44eb50684
MD5 4f86428fa745db66127e786ea78672f2
BLAKE2b-256 7ab6c07f766b24cc3c92e3e24339ccacbc949d004f0fde759cdf24727c5c02bd

See more details on using hashes here.

File details

Details for the file colored-2.3.2-py3-none-any.whl.

File metadata

  • Download URL: colored-2.3.2-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.33.0

File hashes

Hashes for colored-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f192e0545b7214f5479031495d14f4a46b29695650c46a50bf5bb8fb5cbd7893
MD5 1096218dd9ad62f11948f884688af24b
BLAKE2b-256 ee932cfa674b84be707dc0b1653b00f7da9270c78a8fd43f7d80f0d8b1f5ead9

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