Print Everything!
Project description
Printing everything for everyone!
- Project page:
Usage
The perfect printer for Python 3!
Just create a printer instance, pick your favorite colors and get to work!
py-printer supports all ANSI colors, and crazy encodings!
It also calculates the console width in order to wrap words properly.
And! It even works on a standard Windows console using the awesome ANSICON library.
import pyprinter
printer = pyprinter.get_printer()
# Write a simple line.
printer.write_line(printer.YELLOW + 'Hello World!')
# Or use the color functions (nested coloring is also supported).
printer.write_line(printer.yellow('Hello World!'))
# Use indentations.
with printer.group(indent=4):
printer.write_line(printer.GREEN + 'Hello Again!')
# Write aligned values.
printer.write_aligned('Awesomeness', 'Check!')
# Write titles.
printer.write_title('Wow!')
# Print human-readable file sizes.
from pyprinter import FileSize
FileSize(42352352).pretty_print()
# Use tables.
from pyprinter import Table
Table('Test', [[1, 2, 3],['a', 'b', 'c']]).pretty_print()
# Integrate friendly progress bars.
import time
from pyprinter import ProgressBar
progress = ProgressBar(10)
for i in range(10):
time.sleep(1)
progress.eval(i)
progress.finish()
# Use word-wrapping or colors only.
printer = pyprinter.get_printer(colors=False, width_limit=True)
printer.write_line(printer.YELLOW + 'Hello World!')
Install
pip install pyprinter
Development
In order to build a new version, do the following:
Update version string in setup.py (in both version and download_url fields)
Update version in __init__.py file.
Run python setup.py sdist bdist_wheel to create the build
Run twine upload dist/* to upload everything to PyPi
Create a release (and tag) for the new version in GitHub (and delete the old one)
Delete old version from PyPi as well
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
pyprinter-1.3.7.tar.gz
(108.8 kB
view hashes)
Built Distribution
pyprinter-1.3.7-py3-none-any.whl
(111.7 kB
view hashes)
Close
Hashes for pyprinter-1.3.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efdab931d3344116b9f0734a74b7f83d97d0e7b38f3573b294ec00daff3115d0 |
|
MD5 | dd98d1243119ace75557f24846d8430f |
|
BLAKE2b-256 | a004cc8d02804574ee0e0d2f181ffee3f498bd16a38468a4e10f31181c067b56 |