Package for colored organized verbose printing in python.
Project description
Pretty Verbose
Package for beautiful verbose printing in python.
Installation
The package is available in the Python Package Index (PyPi).
python3 -m pip install pretty_verbose
Examples
To use the verbose output, create a VerboseMessages
object.
from pretty_verbose import VerboseMessages
messages = VerboseMessages(
level=3,
scope="main",
filename="messages.log"
)
The level indicates which messages will be printed.
- -1: Just Debug.
- 0: Debug and Errors.
- 1: Debug, Errors and Warnings.
- 2: Debug, Errors Warnings and Success.
- 3: Debug, Errors Warnings, Success and Info.
The scope works to use the VerboseMessages in several instance and differentiate where the message is coming from. Finally the filename will store all the messages printed in the terminal.
The following messages can be printed.
import time
messages.debug("This is a debug message.")
messages.error("This is an error message.")
messages.warning("This is a warning message.")
messages.success("This is a success message.")
messages.info("This is an info message.")
for i in range(100):
if i % 10 == 0:
messages.for_message("This is an info message inside a for loop.")
messages.progress("This is a progress message.", (i+1))
time.sleep(0.1)
The result will be the following.
[28/08/2022 14:12:09] DEBUG [main]: This is an debug message.
[28/08/2022 14:12:09] ERROR [main]: This is an error message.
[28/08/2022 14:12:09] WARNING [main]: This is a warning message.
[28/08/2022 14:12:09] SUCCESS [main]: This is a success message.
[28/08/2022 14:14:06] SUCCESS [main]: This is a success message.
[28/08/2022 14:12:10] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:11] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:13] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:14] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:15] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:16] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:17] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:18] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:19] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:12:20] INFO [main] -- This is an info message inside a for loop.
[28/08/2022 14:14:19] INFO [main] -- This is a progress message.: [100.00%]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pretty_verbose-0.0.7.tar.gz
.
File metadata
- Download URL: pretty_verbose-0.0.7.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e11b0176a96e906b3d910f99855affa514e1507a81834e1371d97da69acde48 |
|
MD5 | f48a46f1c3c5c1aa1f9d0347cc6f6e45 |
|
BLAKE2b-256 | 5aa66d5c72e524c00763e47934703c57cae77626ff29f91b2ded2351a7a7eb02 |
Provenance
The following attestation bundles were made for pretty_verbose-0.0.7.tar.gz
:
Publisher:
python-publish.yml
on ccmorenos/pretty_verbose
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pretty_verbose-0.0.7.tar.gz
- Subject digest:
4e11b0176a96e906b3d910f99855affa514e1507a81834e1371d97da69acde48
- Sigstore transparency entry: 146569593
- Sigstore integration time:
- Predicate type:
File details
Details for the file pretty_verbose-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: pretty_verbose-0.0.7-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 635077886d49b6d227e9c4766644d3955a408f39be05cc9dcf226761d9510b1f |
|
MD5 | a94a5d7d9daaa89f540b0a88852d9622 |
|
BLAKE2b-256 | ebadb0a4ad73b36effe8312d7706791b5b2f3a84b658626f2d2845afeee60103 |
Provenance
The following attestation bundles were made for pretty_verbose-0.0.7-py3-none-any.whl
:
Publisher:
python-publish.yml
on ccmorenos/pretty_verbose
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pretty_verbose-0.0.7-py3-none-any.whl
- Subject digest:
635077886d49b6d227e9c4766644d3955a408f39be05cc9dcf226761d9510b1f
- Sigstore transparency entry: 146569595
- Sigstore integration time:
- Predicate type: