Skip to main content

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.

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': 'a', '2': 'b', '3': '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

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


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.5.3.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

pyprinter-1.5.3-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file pyprinter-1.5.3.tar.gz.

File metadata

  • Download URL: pyprinter-1.5.3.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

File hashes

Hashes for pyprinter-1.5.3.tar.gz
Algorithm Hash digest
SHA256 06da54f3ea3cc8e2b76ec43b4268354d38065a40b75959c9de340f353787d676
MD5 066bb7950949bf5dbc5bf40298bdeeff
BLAKE2b-256 3ee3a6a423b7e30c5bae9c78bec482c3f8a3320e6c54e3c23acb4ccbc4bb8ec7

See more details on using hashes here.

File details

Details for the file pyprinter-1.5.3-py3-none-any.whl.

File metadata

  • Download URL: pyprinter-1.5.3-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1

File hashes

Hashes for pyprinter-1.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a9a2da268f59eae8259e0667698d10670164a86239a0ed05de579633f19b23de
MD5 d0a8fae83361b0f2c51286985f2f4708
BLAKE2b-256 da5334f291070efacb3bba34767fa9416095bcd142064a2a4adf69a3d3b1b9a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page