fortext
Text stylizer for Python. Mainly useful for CLI output.
Table of Contents
Installation
Use pip to install fortext.
python3 -m pip install --upgrade fortext
Usage
Text styling
from fortext import style, Bg, Frmt
print(style('Hi, human.', fg='#ff0000'))
print(style('RGB tuple or list also works.', fg=(0, 255, 0)))
print(style('You can also use predefined colors.', bg=Bg.BLACK))
print(style('Want to be bold?.', frmt=[Frmt.BOLD]))
print(
style('Want to go all in?',
fg='#ff0000', bg=Bg.BLACK,
frmt=[Frmt.BOLD, Frmt.UNDERLINE, Frmt.ITALIC]))
The style function respects the NO_COLOR environment variable. This behavior can be disabled by setting force_color=True.
Print all styles
from fortext import print_styles_all
print_styles_all()
Syntax highlighting
from fortext import highlight
print(highlight({'somekey': 'somevalue', 'anotherkey': [12.4, True, 23]}))
Output:
String permutations
from fortext import permutations
for perm in permutations('abc'):
print(perm)
Output:
a
b
c
ab
ac
ba
bc
ca
cb
abc
acb
bac
bca
cab
cba
Metadata
Release files for fortext 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fortext-2.0.0.tar.gz | 16.7 kB | Without provenance | Details for fortext-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fortext-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for fortext-2.0.0-py3-none-any.whl |
Total release size: 24.9 kB
Release files / fortext-2.0.0.tar.gz
| Download URL | fortext-2.0.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6129ce67c77d42db522812942859ee106e17d4eb382ebf090098bae0413b429e
|
|
BLAKE2b-256 checksum How to use checksums |
2ee01c47f4410938c6ef676f5af3961bc09ba49ad610a788f8d665e1752e3ba2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / fortext-2.0.0-py3-none-any.whl
| Download URL | fortext-2.0.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e95a09fb55406ef53c113bb232915c37d6594f46e3ff269cad8626cf008022b
|
|
BLAKE2b-256 checksum How to use checksums |
44f1b27850d0a4c4f43429c3ef0084e2c4b7fd9a112a27caa2833215688e0bb6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for fortext 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.