pyColour
A python function file that colours output strings.
Contents
Usage
-
Install with
pip install colourpy -
Call the file into your python project with:
from pyColour import *
- Use the following commands in your code. Text colour, background colour and formatting can be used at the same time, by stacking (e.g. `bold(red(bgGreen("Hello world!"))))
NOTE: the outermost colour is the colour that the text will be displayed as (e.g. in yellow(red(green("hello")))), "hello" will be displayed in yellow.
Commands
Basic Colours
| colour | command |
|---|---|
| black | black(string) |
| red | red(string) |
| green | green(string) |
| yellow | yellow(string) |
| blue | blue(string) |
| magenta | magenta(string) |
| white | white(string) |
Bright Variants
| colour | command |
|---|---|
| bright black (grey 1) | bright_black(string) |
| bright red | bright_red(string) |
| bright green | bright_green(string) |
| bright yellow | bright_yellow(string) |
| bright blue | bright_blue(string) |
| bright magenta | bright_magenta(string) |
| bright white (grey 2) | bright_white(string) |
Other Formatting
| Format | Command |
|---|---|
| Bold | bold(string) |
| Underline | underline(string) |
| Reverse | reverse(string) |
256 Colour support
For custom colours, use the following command:
colour_256(string, [0 -> 255])
Highlighting
Highlighting is also possible, and you can use the same commands as before, just with bg infront of it (i.e. bgBlue(string), bgBright_magenta(string))
Note
This project is loosely based on the idea of Simple Chalk.
Edits
| Date | Edit Description | Version |
|---|---|---|
| 27/03/22 | Edits to README.md | 0.1.0 |
Metadata
Release files for colourpy 0.1.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 | |
|---|---|---|---|---|
| colourpy-0.1.0.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| colourpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / colourpy-0.1.0.tar.gz
| Download URL | colourpy-0.1.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84768dcf070c7331b13086aef06dadf16705669e296ce1a47ee95cd8acb114e3
|
|
BLAKE2b-256 checksum How to use checksums |
f4785f596a80c6017d592433f5f7e9df7a305273bdf9aedc928410adcd446728
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3
|
Release files / colourpy-0.1.0-py3-none-any.whl
| Download URL | colourpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09816509321b6e4c0a04c41e06814cd2ce5bdc1950e067f69427c40b216d430c
|
|
BLAKE2b-256 checksum How to use checksums |
32dd60c185a7bc90f9a3f9da2fba4875ee204e7d84674ba57f97890bee203740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3
|
Security for colourpy 0.1.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.