https://github.com/probablykasper/colorboy-py
python package - Easily add color to your strings
https://github.com/probablykasper/colorboy-py
ansi cli color package terminal
Last synced: about 2 months ago
JSON representation
python package - Easily add color to your strings
- Host: GitHub
- URL: https://github.com/probablykasper/colorboy-py
- Owner: probablykasper
- Created: 2018-10-01T15:51:18.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-03-12T21:47:47.000Z (over 5 years ago)
- Last Synced: 2026-01-06T04:48:59.063Z (6 months ago)
- Topics: ansi, cli, color, package, terminal
- Language: Python
- Homepage: https://pypi.org/project/colorboy
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# colorboy
Easily add color to your strings
## Installation
```
pip install colorboy
```
## Usage
```python
import colorboy as cb
print(cb.cyan('Globgogabgalab'))
# import specific colors, bg_colors and styles
from colorboy import white_bg, black
print(white_bg(black('Pog')))
# import everything
from colorboy import *
print(green('Mayonnaise'))
from colorboy.colors import * # import all colors
print(red('EDEN'))
from colorboy.bg_colors import * # import all bg_colors
print(black_bg('Stephen'))
from colorboy.styles import * # import all styles
print(bright('Crywolf'))
```
## Colors
These are all the color functions available through colorboy:
```python
# colors - available by importing colorboy or colorboy.colors
black
red
green
yellow
blue
magenta
cyan
white
# bg_colors - available by importing colorboy or colorboy.bg_colors
black_bg
red_bg
green_bg
yellow_bg
blue_bg
magenta_bg
cyan_bg
white_bg
# styles - available by importing colorboy or colorboy.styles
dim
bright
```
## Dev Instructions
### Get started
1. Install Python (Python 3.7 works, probably other versions too)
2. Install [Poetry](https://poetry.eustace.io). Poetry is used to manage dependencies, the virtual environment and publishing to PyPI, so it's worth learning
3. Run `poetry install` to install Python package dependencies
I recommend running `poetry config virtualenvs.in-project true`, which makes Poetry store your Python virtual environment inside the project folder. Additionally, it lets VSCode's Python extension detect the virtual environment if you set the `python.pythonPath` setting to `${workspaceFolder}/.venv/bin/python` in your settings.
### Running
To test if things work, you can run the following command to open the Python REPL. Then you can write Python, such as the usage examples:
```
poetry run python
```
### Releasing a new version
1. Consider updating the lockfile by running `poetry update`, then check if thing still work
2. Bump the version number:
```
poetry version
```
3. Update `CHANGELOG.md`
4. Build:
```
poetry build
```
5. Commit and create git tag
6. Create GitHub release with release notes and attach the build files
7. Publish to PyPi:
```
poetry publish
```