printbuddies
Various printing utilities and helpers/extenders for the rich package.
Install with:
pip install printbuddies
print_in_place
'print_in_place' erases the current line in the terminal and then writes the value of
the 'string' param to the terminal.
from printbuddies import print_in_place
import time
#This will print numbers 0-99 to the terminal with each digit overwriting the last.
for i in range(100):
print_in_place(i)
time.sleep(0.1)
Tag
The Tag class is essentially a wrapper to shorten using rich tags.
When a Tag is casted to a string it is formatted with surrounding square brackets
and the o or off properties can be accessed to return the matching closing tag.
from printbuddies import Tag
p = Tag("pale_turquoise4")
c = Tag("cornflower_blue")
s = f"{p}This{p.o} {c}is{c.o} {p}a{p.o} {c}string"
is equivalent to
s = "[pale_turquoise4]This[/pale_turquoise4] [cornflower_blue]is[/cornflower_blue] [pale_turquoise4]a[/pale_turquoise4] [cornflower_blue]string"
The ColorMap class contains two Tag properties for each
named color
(except shades of grey, those only have a full name property):
one that's the full name of the color and one that's an abbreviated name, for convenience.
This is useful for seeing color options using autocomplete:
The class also supports iterating over the tags as well as selecting random colors:
The Gradient class inherits from list and can be used to easily apply an arbitrary number of color sweeps across text:
The Progress, BarColumn, and TaskProgressColumn classes, as well as the track function are the same as the rich versions, just with different default colors, default columns, and additonal keyword arguments.
TimerColumn is a subclass of rich.progress.TimeRemainingColumn that displays {time_elapsed}<->{time_remaining} with a color gradient.
Default columns and colors of this version:
The Grid class is a customized implementation of a rich Table.
It can minimally be used by passing a list of dictionaries to the constructor and then passing the instance
to rich.print or rich.console.Console().print.
(All dictionaries should have the same set of keys)
from printbuddies import Grid from rich import print print(Grid(list_of_dicts))
Being used to display a database schema:
Metadata
Release files for printbuddies 2.1.3
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 |
|---|---|---|---|---|
| printbuddies-2.1.3.tar.gz | 16.9 kB | Without provenance | Details for printbuddies-2.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| printbuddies-2.1.3-py3-none-any.whl | Python 3 | none | any | Details for printbuddies-2.1.3-py3-none-any.whl |
Total release size: 35.6 kB
Release files / printbuddies-2.1.3.tar.gz
| Download URL | printbuddies-2.1.3.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5968b25da113281ce4f09d881e7e566f7d630a938653c399faba57097b7e474f
|
|
BLAKE2b-256 checksum How to use checksums |
83fdea028b4ff877d606ed256579aafc1ffbe5196a4f6d46da43ac2f3443163c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / printbuddies-2.1.3-py3-none-any.whl
| Download URL | printbuddies-2.1.3-py3-none-any.whl |
|---|---|
| Size | 18.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e5d3642410dbb5a05feae3b772c1323661d9897b717668079ded10d592d57bf
|
|
BLAKE2b-256 checksum How to use checksums |
0ceec659c9325366233134abc39749dde4dc3e169d1d9f22857c92e02e0f300e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for printbuddies 2.1.3
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.