jmessaging
jmessaging is a very simple package (with no dependencies!) that makes
printing colorized messages to the console a breeze.
Usage
import jmessaging as jm
messenger = jm.Messenger()
messenger.info('This is a message')
messenger.warning('This is a warning')
messenger.error('This is an error')
would result in
Changing the brackets and text color
The brackets around the message type can be changed along with the color associated with the type
import jmessaging as jm
messenger = jm.Messenger()
messenger._left = '<'
messenger._right = '>'
messenger._info = jm.jcolor.blue + jm.jstyle.bold
messenger._warning = jm.jcolor.magenta + jm.jstyle.bold
messenger._error = jm.jcolor.green + jm.jstyle.bold
messenger.info('This is a message')
messenger.warning('This is a warning')
messenger.error('This is an error')
would result in
Changing background color
import jmessaging as jm
messenger = jm.Messenger()
messenger._info = jm.jbackground.black + jm.jcolor.white + jm.jstyle.bold
messenger._warning = jm.jbackground.yellow + jm.jcolor.white + jm.jstyle.bold
messenger._error = jm.jbackground.red + jm.jcolor.white + jm.jstyle.bold
messenger.info('This is a message')
messenger.warning('This is a warning')
messenger.error('This is an error')
would result in
Colorizing text
Text can be colorized using the jcolorize function from the jcolor module
like so
import jmessaging as jm
colorized = jm.jcolorize('This is text', jm.jcolor.cyan)
print(colorized)
would result in
Printing on the same line
You can print on the same line repeatedly using the print_same_line function
like so
import time
import jmessaging as jm
for i in range(1000, 0, -1):
jm.print_same_line(f'Current num: {i}')
time.sleep(0.001)
print('\n')
would result in
Notice the print('\n') at the end. That's necessary (or use print()) to move
the cursor to the next line.
Metadata
Release files for jmessaging 0.3.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 | Actions |
|---|---|---|---|---|
| jmessaging-0.3.0.tar.gz | 46.9 kB | Without provenance | Details for jmessaging-0.3.0.tar.gz |
Release files / jmessaging-0.3.0.tar.gz
| Download URL | jmessaging-0.3.0.tar.gz |
|---|---|
| Size | 46.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18a74a7206a99a644108a3381fafbd88a505bf65b816371fbe14726fd0a13e04
|
|
BLAKE2b-256 checksum How to use checksums |
c3b52302fbab018dfccafa5ccde4340db213b0e3c31c48f1464fe5ad7f81cc1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for jmessaging 0.3.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.