An elegant console reporter, a python port of Yournalist
Project description
Pyrnalist
An elegant console reporter, a python port of Yournalist.
Introduction
Pretty console output makes developers happy and Yarn is doing a nice job. Pyrnalist is an incomplete rewrite of Node.js's Yournalist, which in turn is a public version of Yarn internal console reproter.
Yurnalist can be used to report many different things besides simple messages.
Features
- log, info, warn, succes, error & command messages
- activity spinners
- emojis
- process steps
- lists
- program header & footer
- progress bars
- integration with logging module
Missing features of Yournalist
- object inspection
- trees
- tables
- user question
- user select
Install
pip install pyrnalist
How to use
Here is an example showing a combination of different reporter API functions.
from pyrnalist import report
import time
report.header("pyrnalist", version="0.1.2")
report.info("Please wait while I fetch something for you.")
report.warn("It might take a little while though.")
spinner = report.activity()
spinner.tick("I am on it!")
time.sleep(1)
spinner.tick("Still busy...")
time.sleep(1)
spinner.tick("Almost there...")
time.sleep(1)
report.success("Done!")
spinner.end()
steps = 15
tick = report.progress(steps)
report.info("🥚 Wait for it...")
for x in range(steps):
tick()
if x % 5 == 0:
report.warn("Interrupt.")
time.sleep(0.25)
report.success("🐣 Tjiep!")
report.footer()
Configuration
A normal import gives you a reporter instance configured with defaults for easy
use. If you want something else you can call create_reporter() to give
you an instance with different options.
Options
These are the options of the reporter as defined by Flow:
create_reporter(
name="logger-name",
verbose=True,
silent=False,
emoji=True,
no_progress=False,
logging_handler=True,
)
Credits
Of course ❤️ and credits to all the contributers of Yournalist and Yarn. The ease with which I was able to port the module to python from their codebase is proving some awesome engineering skills.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrnalist-0.1.2.tar.gz.
File metadata
- Download URL: pyrnalist-0.1.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6af1f480343394021471142a6cba53bc7b0168045a4c1a8eb2189c3c5e90a5b7
|
|
| MD5 |
bc95777fa2a89b60be461cd2cec077de
|
|
| BLAKE2b-256 |
c51ea42895bc58df952314a4d3864335b5e4b8083fbff01649e9dcbf31471ac0
|
File details
Details for the file pyrnalist-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyrnalist-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
025f453122eefbd20a63d60438c313f4d254ccf696a7842cbbb6df1ecd8d6ff4
|
|
| MD5 |
4db4b58fc4929d20ca6d16c25c85bf70
|
|
| BLAKE2b-256 |
807ddc38af2f120bec78dd10f1f7e22de9cdc5b30007de50b09537da3881cf2f
|