Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stephen-bunn/chalky
Simple ANSI terminal text coloring
https://github.com/stephen-bunn/chalky
chalk color terminal
Last synced: 16 days ago
JSON representation
Simple ANSI terminal text coloring
- Host: GitHub
- URL: https://github.com/stephen-bunn/chalky
- Owner: stephen-bunn
- License: isc
- Created: 2020-12-12T07:16:13.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-19T17:12:13.000Z (almost 4 years ago)
- Last Synced: 2024-11-08T04:10:41.209Z (2 months ago)
- Topics: chalk, color, terminal
- Language: Python
- Homepage:
- Size: 2.27 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
![Chalky](https://github.com/stephen-bunn/chalky/raw/master/docs/source/_static/assets/img/Chalky.png)
[![Supported Versions](https://img.shields.io/pypi/pyversions/chalky.svg)](https://pypi.org/project/chalky/)
[![Test Status](https://github.com/stephen-bunn/chalky/workflows/Test%20Package/badge.svg)](https://github.com/stephen-bunn/chalky)
[![Documentation Status](https://readthedocs.org/projects/chalky/badge/?version=latest)](https://chalky.readthedocs.io/)
[![Codecov](https://codecov.io/gh/stephen-bunn/chalky/branch/master/graph/badge.svg?token=G3KRpTeg5J)](https://codecov.io/gh/stephen-bunn/chalky)
[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)> Simple ANSI terminal text coloring
Yet another terminal text coloring libraryβ¦
Why? Because, I like certain things and I hate certain things about the currently
available solutions.
This here is my attempt to build an interface for simply applying ANSI escape sequences
to strings that I enjoy and can update at my own free will.
That is it, there is nothing new or interesting that this packages adds.
Thanks πFor more interesting details, please visit the
[documentation](https://chalky.readthedocs.io/).## Style Composition
```python
from chalky import sty, fgmy_style = sty.bold & fg.red
print(my_style | "This is red on black")
print(my_style.reverse | "This is black on red")
```![Basic Colors](https://github.com/stephen-bunn/chalky/raw/master/docs/source/_static/assets/img/basic.png)
## Style Chaining
```python
from chalky import chainprint(chain.bold.green | "I'm bold green text")
print(chain.white.bg.red.italic | "I'm italic white text on a red background")
```![Style Colors](https://github.com/stephen-bunn/chalky/raw/master/docs/source/_static/assets/img/chaining.png)
## Truecolor
```python
from chalky import rgb, sty, hexprint(rgb(23, 255, 122) & sty.italic | "Truecolor as well")
print(sty.bold & hex("#ff02ff") | "More and more colors")
```![True Colors](https://github.com/stephen-bunn/chalky/raw/master/docs/source/_static/assets/img/truecolor.png)
## Disable Colors
```python
from chalky import configure, fgprint(fg.red | "I am red text")
configure(disable=True)
print(fg.red | "I am NOT red text")
```![Configure](https://github.com/stephen-bunn/chalky/raw/master/docs/source/_static/assets/img/configure.png)