Skip to main content
# CliRAINBOW
Easily print colored text.

## Example usage
```python
>>> from clirainbow import Colorizer, RED, GREEN
>>> c = Colorizer()
>>> c.print('<hello> <world!>', RED, GREEN)
```

## Additional info

* If you want to insert a literal bracket, double it (e.g. write `<<` instead of `<`)
* (this is the same behavior as Python's builtins)
* Angle brackets are used instead of the traditional curly brackets in order to prevent clashes with Python's builtin string formatting facilities


## Exceptions

At the moment, three possible exceptions may occur while using the library :
1. A color bracket is opened, but never closed (`ColorBracketOpenedButNotClosed`)
2. More brackets than colors are given (`MoreBracketsThanColors`)
3. More colors than brackets are given (`MoreColorsThanBrackets`)

In each case, a readable error message is produced

## Disclaimer
Colors may not appear on certain systems (e.g., Windows) or with certain terminals.

## Dependencies
CliRAINBOW is built on top of colorama : https://github.com/tartley/colorama

## Future plans
* Generate code in `colors.py` with a script instead of at runtime
* Allow code completion
* Remove annoying error messages
* Add support for reusing colors by index, e.g. `c.print('<0:oh> <1:hai> <0:there>', colors.RED, colors.BLACK)`
* Make it more similar to Python's `format`


Metadata

Release files for clirainbow 1.2.0

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

Source distribution (sdist)

Source distribution for clirainbow 1.2.0
File Size Uploaded Provenance Actions
clirainbow-1.2.0.tar.gz 3.7 kB Without provenance Details for clirainbow-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clirainbow 1.2.0
File Interpreter ABI Platform Actions
clirainbow-1.2.0-py3-none-any.whl Python 3 none any Details for clirainbow-1.2.0-py3-none-any.whl

Total release size: 10.0 kB

Release files / clirainbow-1.2.0.tar.gz

Download URL clirainbow-1.2.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9e08075c7e2d7449c38fd180a4d04b6c81358cc3f738c4351e28a78e8c4bb455
BLAKE2b-256 checksum
How to use checksums
95eefffd2a639b3547bef3a5059fe772ad9d476e3458b2e3885c20cee3654b46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Release files / clirainbow-1.2.0-py3-none-any.whl

Download URL clirainbow-1.2.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
328db8c31bc4380579a08d5a73e5379c1f9db27d8055889bfa5d2862b51219e5
BLAKE2b-256 checksum
How to use checksums
2479c5d4183b9cf1fe283d9c61863e6f5e1a4bad2a7c3ebe35c97a9ba07fdfbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Security for clirainbow 1.2.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.

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