tcolopy is a Python library to apply true color for terminal text.
Project description
Summary
tcolopy is a Python library to apply true color for terminal text.
Installation
Installation: pip
pip install tcolorpy
Installation: conda
conda install -c conda-forge tcolorpy
Usage
Library usage
- Sample Code:
from tcolorpy import tcolor print(tcolor("tcolopy example", color="#ee1177", styles=["bold", "italic", "underline"]))- Output:
You can set the following tcolor arguments:
- color/bg_color
color names ("red", "green", etc.) or color code ("#RRGGBB")
- styles
"bold", "italic", etc.
Other examples
Apply true color and styles to text:
You can also specify colors by name:
CLI usage
tcolorpy can be used via CLI:
$ python3 -m tcolorpy "tcolopy example" -c "#ee1177" -s bold,italic,underline
Command help
usage: __main__.py [-h] [-c COLOR] [-b BG_COLOR] [-s STYLES] [--encode ENCODE] string
positional arguments:
string string to apply styles.
options:
-h, --help show this help message and exit
-c COLOR, --color COLOR
specify a color code (#XXXXXX) or a name. valid names are: black, red, green, yellow, blue, magenta, cyan, white, lightblack, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, lightwhite
-b BG_COLOR, --bg-color BG_COLOR
specify a background color code (#XXXXXX) or a name. valid names are: black, red, green, yellow, blue, magenta, cyan, white, lightblack, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, lightwhite
-s STYLES, --styles STYLES
specify a comma-separated style. valid values are: bold, dim, italic, underline, blink, invert, strike
--encode ENCODE output a text encoded with the specified encoding
Dependencies
Python 3.9+ no external dependencies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tcolorpy-0.1.7.tar.gz.
File metadata
- Download URL: tcolorpy-0.1.7.tar.gz
- Upload date:
- Size: 299.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fbf6bf238890bbc2e32662aa25736769a29bf6d880328f310c910a327632614
|
|
| MD5 |
6232d098c4531507e2aa04fe34fb8cd3
|
|
| BLAKE2b-256 |
80cc44f2d81d8f9093aad81c3467a5bf5718d2b5f786e887b6e4adcfc17ec6b9
|
Provenance
The following attestation bundles were made for tcolorpy-0.1.7.tar.gz:
Publisher:
release.yml on thombashi/tcolorpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tcolorpy-0.1.7.tar.gz -
Subject digest:
0fbf6bf238890bbc2e32662aa25736769a29bf6d880328f310c910a327632614 - Sigstore transparency entry: 158118290
- Sigstore integration time:
-
Permalink:
thombashi/tcolorpy@24f927faf9484d66a754cd2f931fa986d779dd00 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/thombashi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f927faf9484d66a754cd2f931fa986d779dd00 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tcolorpy-0.1.7-py3-none-any.whl.
File metadata
- Download URL: tcolorpy-0.1.7-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26a59d52027e175a37e0aba72efc99dda43f074db71f55b316d3de37d3251378
|
|
| MD5 |
07640b00fad88519fc0b41a6d2b008ef
|
|
| BLAKE2b-256 |
05a2ed023f2edd1e011b4d99b6727bce8253842d66c3fbf9ed0a26fc09a92571
|
Provenance
The following attestation bundles were made for tcolorpy-0.1.7-py3-none-any.whl:
Publisher:
release.yml on thombashi/tcolorpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tcolorpy-0.1.7-py3-none-any.whl -
Subject digest:
26a59d52027e175a37e0aba72efc99dda43f074db71f55b316d3de37d3251378 - Sigstore transparency entry: 158118291
- Sigstore integration time:
-
Permalink:
thombashi/tcolorpy@24f927faf9484d66a754cd2f931fa986d779dd00 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/thombashi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f927faf9484d66a754cd2f931fa986d779dd00 -
Trigger Event:
push
-
Statement type: