farbe
Installation
$ pip install farbe
Test
Just type in these commands and check if your terminal can print colors properly:
>>> import farbe
>>> farbe.test()
It prints the supported combinations of colors and effects:
Basic Usage
Specify the color you want to use and feed a string to the Farbe object's print method.
>>> from farbe import Color, Farbe
>>> bb = Farbe(Color.Fg.BrightBlue)
>>> bb.print('Hello, Bright Blue')
Hello, Bright Blue
>>> white_fg_red_bg = Farbe(Color.Fg.White, Color.Bg.Red)
>>> white_fg_red_bg.print('White characters on red background')
White characters on red background
>>> italic = Farbe(Color.Fg.Normal, effects=[Color.Effect.Italic])
>>> italic.print('Characters in italic')
Characters in italic
Using Colored objects
Colored objects can be used in combination with normal strings.
>>> red = Farbe(Color.Fg.Red)
>>> yellow = Farbe(Color.Fg.Yellow)
>>> error = red.colored('Error')
>>> warning = yellow.colored('Warning')
>>> print('[' + error + '] Something went wrong!')
[Error] Something went wrong!
>>> print('🐍 ' + warning + '! 🐍')
🐍 Warning! 🐍
Supported Colors and Effects
Foreground Colors
| Color Name | Code |
|---|---|
| Normal | Color.Fg.Normal |
| Black | Color.Fg.Black |
| Red | Color.Fg.Red |
| Green | Color.Fg.Green |
| Yellow | Color.Fg.Yellow |
| Blue | Color.Fg.Blue |
| Magenta | Color.Fg.Magenta |
| Cyan | Color.Fg.Cyan |
| White | Color.Fg.White |
| BrightBlack | Color.Fg.BrightBlack |
| BrightRed | Color.Fg.BrightRed |
| BrightGreen | Color.Fg.BrightGreen |
| BrightYellow | Color.Fg.BrightYellow |
| BrightBlue | Color.Fg.BrightBlue |
| BrightMagenta | Color.Fg.BrightMagenta |
| BrightCyan | Color.Fg.BrightCyan |
| BrightWhite | Color.Fg.BrightWhite |
Background Colors
| Color Name | Code |
|---|---|
| Normal | Color.Bg.Normal |
| Black | Color.Bg.Black |
| Red | Color.Bg.Red |
| Green | Color.Bg.Green |
| Yellow | Color.Bg.Yellow |
| Blue | Color.Bg.Blue |
| Magenta | Color.Bg.Magenta |
| Cyan | Color.Bg.Cyan |
| White | Color.Bg.White |
| BrightBlack | Color.Bg.BrightBlack |
| BrightRed | Color.Bg.BrightRed |
| BrightGreen | Color.Bg.BrightGreen |
| BrightYellow | Color.Bg.BrightYellow |
| BrightBlue | Color.Bg.BrightBlue |
| BrightMagenta | Color.Bg.BrightMagenta |
| BrightCyan | Color.Bg.BrightCyan |
| BrightWhite | Color.Bg.BrightWhite |
Effects
| Effect | Code |
|---|---|
| Bold | Color.Effect.Bold |
| Faint | Color.Effect.Faint |
| Italic | Color.Effect.Italic |
| Underline | Color.Effect.Underline |
| SlowBlink | Color.Effect.SlowBlink |
| RapidBlink | Color.Effect.RapidBlink |
| Reverse | Color.Effect.Reverse |
| Conceal | Color.Effect.Conceal |
| CrossOut | Color.Effect.CrossOut |
Metadata
Release files for farbe 0.1
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 | |
|---|---|---|---|---|
| farbe-0.1.tar.gz | 3.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| farbe-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.7 kB
Release files / farbe-0.1.tar.gz
| Download URL | farbe-0.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e456dad7f70635c5d2ead077c60d1b8243d9817b90a607811f3d0e677bd25de
|
|
BLAKE2b-256 checksum How to use checksums |
14d0c56c2d2b0687c44e949e1017802220d2037bb0f21f570d02d6a622f2c32e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
|
Release files / farbe-0.1-py3-none-any.whl
| Download URL | farbe-0.1-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
268e35d9c6f2b485864b11a9de4543d83d41b48d4a8e575a40cd625c5be6ba88
|
|
BLAKE2b-256 checksum How to use checksums |
35da66fb1ef5c7b5d71f6920823b3658ee2cfdef26882fdc9193348c842de1d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
|
Security for farbe 0.1
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.