Skip to main content

A short alias for the pprintpp or pprint module

Project description

pp can be installed with Python 2 or Python 3 using pip or easy_install:

$ pip install pprintpp pp-ez
- OR -
$ easy_install pprintpp pp-ez

The pp package is just an alias for the pprintpp package (and falls back to the pprint package if pprintpp isn’t available), plus a bit of magic so it can be called directly:

>>> import pp
>>> pp(["Hello", "world"])
["Hello", "world"]
>>> pp.fmt([1, 2, 3])
'[1, 2, 3]'
>>> pp.pprint([1, 2, 3])
[1, 2, 3]
>>> pp.pformat([1, 2, 3])
'[1, 2, 3]'

By default, pp tries to use the pprintpp package, but if that is not available it will fall back to using pprint:

>>> import pp
>>> pp
<module 'pp' (pp_magic_module with pprint_mod='pprint')>
>>> pp.pprint_mod
<module 'pprint' from '.../lib/python2.7/pprint.pyc'>

See also: pprint++: https://pypi-hypernode.com/pypi/pprintpp

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

pp-ez-0.2.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

pp_ez-0.2.0-py2.py3-none-any.whl (3.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pp-ez-0.2.0.tar.gz.

File metadata

  • Download URL: pp-ez-0.2.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pp-ez-0.2.0.tar.gz
Algorithm Hash digest
SHA256 87b9e5a0fdd7ced5b46d1b61706113cac9ec1670a76b10d308334db44c20cc29
MD5 8dc8ae37adaf6239e888d62ceb592809
BLAKE2b-256 6a6feb7883bbc0c2658229266e93e2eadeb503a4b120f4a19806348685d2ee37

See more details on using hashes here.

File details

Details for the file pp_ez-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pp_ez-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 554dc28eff8b2df864fcd3326bd5fa0ec3f2b85bc9590fd96771a7c49e45c121
MD5 e69483163bf34a591c617e7b72d8bdac
BLAKE2b-256 3efb71815f82143b90c82a2e1b4fdd2e556b124d8b4e3c570297d69f9c4ded1d

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page