supports-color
Detect whether a terminal supports color
A port of the Node.js package supports-color to Python.
Install
python3 -m pip install -U supports-color
Usage
from supports_color import supportsColor
if supportsColor.stdout:
print('Terminal stdout supports color');
if supportsColor.stdout.has256:
print('Terminal stdout supports 256 colors');
if supportsColor.stderr.has16m:
print('Terminal stderr supports 16 million colors (truecolor)');
API
See chalk/supports-color API docs.
License
MIT
Contact
A library by Shawn Presser. If you found it useful, please consider joining my patreon!
My Twitter DMs are always open; you should send me one! It's the best way to reach me, and I'm always happy to hear from you.
- Twitter: @theshawwn
- Patreon: https://www.patreon.com/shawwn
- HN: sillysaurusx
- Website: shawwn.com
Metadata
Release files for supports-color 0.2.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 |
|---|---|---|---|---|
| supports-color-0.2.0.tar.gz | 4.2 kB | Without provenance | Details for supports-color-0.2.0.tar.gz |
Release files / supports-color-0.2.0.tar.gz
| Download URL | supports-color-0.2.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
209d3e5c7f267b9b7c2dfbae9e2c546ea386b43f1855ccc96639e2769d042d14
|
|
BLAKE2b-256 checksum How to use checksums |
74f8b4cae888902982943738420cc0594f30a4a5926bf4a7ededa2ad8679645b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.13
|
Security for supports-color 0.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.