Skip to main content

more_termcolor

Pass unlimited number of colors, color-codes, or attributes

All standard, background, bright, or attribute codes are available (or any combination of them)
Intelligently handles existing colors in the text as to allow adding or combining colors automatically, while ensuring the smallest string size possible

Convenience methods that expose shortcuts to common values (bold('foo'), yellow('bar') etc)
100% compatible with the classic termcolor lib: anything that works with termcolor works the same with more_termcolor

Example

# This is also possible:
from more_termcolor.colors import bold, brightgreen
bold_text = bold('text')
fancy = brightgreen(f'this whole string, including this {bold_text} is bright green')
>>> this whole string, including this text is bright red

Roadmap (work in progress)

- Parse complex color args, such as:
cprint('foo', 'bold bright blue on black')
>>> foo
- pygments-like support for pseudo HTML tags, e.g.:
text = "<magenta>some text<on yellow>that shows</on yellow>what's <bold ul>planned</bold ul></magenta>"
cprint(text) 
>>> some text that shows what's planned
- Custom tags:
text = "<m>some text<oy>that shows</oy>what's <bu>planned</bu></m>"
cprint(text, m='magenta', oy='on yellow', bu='bold ul') 
>>> some text that shows what's planned
- Colorize by regex:
stuff = {'food': 'pizza', 'love': 'wife'}
cprint(stuff, bold=r"'\w+':")
>>> {'food': 'pizza', 'love': 'wife'}

Metadata

Release files for more-termcolor 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for more-termcolor 1.1.3
File Size Uploaded
more_termcolor-1.1.3.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for more-termcolor 1.1.3
File Interpreter ABI Platform
more_termcolor-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / more_termcolor-1.1.3.tar.gz

Download URL more_termcolor-1.1.3.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5d4c193c6b680fff8cc676d7f43af6d53e49e5b89f0ad0a1ebe8b3ff5112ebf7
BLAKE2b-256 checksum
How to use checksums
a98bcd7b302d5cdee965434901671c700e3a14b5d7c03b80929868bb14bd5989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6

Release files / more_termcolor-1.1.3-py3-none-any.whl

Download URL more_termcolor-1.1.3-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e0ad652159b20fbce3c52611d619a91bc66f9a7dde49bda76008b83349a6995
BLAKE2b-256 checksum
How to use checksums
10cf951eeb24766da4178d5cb54c58e9991e7d94fb4422d058da4dd36ef3fbb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.5

2 release 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