Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Print Everything!

Project description

Printing everything for everyone!

Latest Version Travis CI build status
Project page:https://github.com/ofir123/py-printer

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!'))
docs/images/simple.png
# Use indentations.
with printer.group(indent=4):
    printer.write_line(printer.GREEN + 'Hello Again!')
docs/images/indented.png
# Write aligned values.
printer.write_aligned('Awesomeness', 'Check!')
docs/images/aligned.png
# Write titles.
printer.write_title('Wow!')
docs/images/title.png
# Print human-readable file sizes.
from pyprinter import FileSize

FileSize(42352352).pretty_print()
docs/images/file_size.png
# Use tables.
from pyprinter import Table

Table('Test', [[1, 2, 3],['a', 'b', 'c']]).pretty_print()
docs/images/table.png
# 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()
docs/images/progress_bar.png
# Use word-wrapping or colors only.
printer = pyprinter.get_printer(colors=False, width_limit=True)
printer.write_line(printer.YELLOW + 'Hello World!')
docs/images/no_colors.png

Install

pip install pyprinter

Project details


Release history Release notifications

This version
History Node

1.2.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyprinter-1.2.2-py3-none-any.whl (72.0 kB) Copy SHA256 hash SHA256 Wheel py3 Dec 30, 2017
pyprinter-1.2.2.tar.gz (62.5 kB) Copy SHA256 hash SHA256 Source None Dec 30, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page