[READ-ONLY] Mirror of https://github.com/probablykasper/colorboy-py. python package - Easily add color to your strings pypi.org/project/colorboy
ansi cli color package terminal
0

Configure Feed

Select the types of activity you want to include in your feed.

Python 100.0%
11 1 4

Clone this repository

https://tangled.org/kasper.space/colorboy-py https://tangled.org/did:plc:37anxtmuj32jinxiyl4yetvi
git@tangled.org:kasper.space/colorboy-py git@tangled.org:did:plc:37anxtmuj32jinxiyl4yetvi

For self-hosted knots, clone URLs may differ based on your setup.



README.md

colorboy#

Easily add color to your strings

Installation#

pip install colorboy

Usage#

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:

# 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. 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 <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