Coolours
A Python Module To Make Text Styling Easy
Made By Alex Hawking
Installation
With Pip
Install with:
pip install coolours
or
pip3 install coolours
With wget
Wget must be installed
cd ~/Library/Python/3.7/lib/python/site-packages && wget https://raw.githubusercontent.com/Handmade-Studios/coolours-module/master/coolours/coolours.py && cd ~
Probably easier to copy and paste that ^
Usage
Importing
Import coolours using:
from coolours.colour import *
You can import with
import coolours.colour
But that requires you to use print(coolours.colour('style', 'textcolour', 'backgroundcolour')), so I think it is easier to use the first method.
Colours
You use coolours within the print function as shown below:
print(colour('style', 'text-colour', 'background-colour') + 'your text')
Make sure you place the colours and styles within quotes
Alignment
To center text use:
print(center('yourtext'))
To align text to the right use:
print(right('yourtext'))
To use alignment with colour:
print(colour('style', 'textcolour', 'bgcolour') + center('yourtext'))
Default
To make the colours back to default after the coloured text add default to the end of the print function:
print(colour('style', 'text-colour', 'background-colour') + 'your text' + default)
Updating
To update use:
pip install --upgrade coolours
Or:
pip3 install --upgrade coolours
List of Colours
Coolours contains the following colours:
Styles
- none
- bold
- underline (not supported in all temrinals)
- blink (not supported in all terminals)
Text Colours
- none
- black
- red
- green
- yellow
- blue
- purple
- cyan
- white
- brightblack
- brightred
- brightgreen
- brightyellow
- brightblue
- brightpurple
- brightcyan
- brightwhite
Background Colours
- none
- black
- red
- green
- yellow
- blue
- purple
- cyan
- white
- brightblack
- brightred
- brightgreen
- brightyellow
- brightblue
- brightpurple
- brightcyan
- brightwhite
Alignments
- Right
- Center
Future
More colours and styles coming soon. Will add some sort of fancy text.
Metadata
Release files for coolours 0.6
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 | |
|---|---|---|---|---|
| coolours-0.6.tar.gz | 3.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coolours-0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / coolours-0.6.tar.gz
| Download URL | coolours-0.6.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b3d5b9b8204003837461f79638b5fd0cd65113a2bf38e348ff8479d3ec9d98f
|
|
BLAKE2b-256 checksum How to use checksums |
1905a1766ee0e58ccd527ebbe4d9c329112009debb65514d6f82419d7030f9c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Release files / coolours-0.6-py3-none-any.whl
| Download URL | coolours-0.6-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1dc0f2699d7746e9b5e4cce15d046f73b89ded928fa88ad5237dd47c3853d271
|
|
BLAKE2b-256 checksum How to use checksums |
cc12063b20edf1273547e138eac12a81251cb1af6d0ab1877ae00acfb57b54a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for coolours 0.6
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.