Skip to main content

consolor

https://travis-ci.org/paetzke/consolor.png?branch=master https://coveralls.io/repos/paetzke/consolor/badge.png?branch=master https://pypip.in/v/consolor/badge.png

Consolor provides highlighting functions for terminals.

It comes with there 3 functions:

get_line

Returns a string with the given formatting.

print_line

Prints a string with the given formatting.

update_line

Overwrites the output of the current line and prints s on the same line without a new line.

All these functions accept the following formatting parameters:

  • bold: bool, default False

  • underline: bool, default False

  • blinking: bool, default False

  • color: str, default None

  • bgcolor: str, default None

https://paetzke.me/static/images/consolor.png

Some examples:

import consolor

consolor.print_line('light green', color=consolor.Color.LightGreen)
consolor.print_line('underline', underline=True)
consolor.print_line('green bg', bgcolor=consolor.BgColor.Green)
consolor.update_line('0%')
consolor.update_line('100%')
print()

For more colors and background colors see consolor.Color and consolor.BgColor.

You can also use it in builtin print():

import consolor

print(consolor.Color.Red, 'Red')
print('Red two')
print(consolor.Color.Reset, end='') # You have to handle resetting your self.
print('Not Red')

print(consolor.BgColor.Red, 'Red')
print('Red two', consolor.BgColor.Reset)
print('None')

To install consolor use pip.

pip install consolor

Bugs and improvements

Feel free to open tickets or send pull requests with improvements. These contributors have done so.

Metadata

Release files for consolor 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for consolor 0.1.2
File Size Uploaded
consolor-0.1.2.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for consolor 0.1.2
File Interpreter ABI Platform
consolor-0.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 8.9 kB

Release files / consolor-0.1.2.tar.gz

Download URL consolor-0.1.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dbfd70cf71bcf0788359ba06468bd1e663b3dbc1c5314d41e5016a14b9186485
BLAKE2b-256 checksum
How to use checksums
941cd005f288aae9c872541d9fb5ae21abdc3981d8e30f9827ab8517e9077c16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / consolor-0.1.2-py2.py3-none-any.whl

Download URL consolor-0.1.2-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a90353c35aa0a915c017588edc4b2ebb7e6d21a68ea8b1a0166ec5c6fe05f7a5
BLAKE2b-256 checksum
How to use checksums
2694e6c185e9c381199b3965fb8c2491294acf8830e7096a7618494cd1f2a65e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page