Skip to main content

backport of pprint from python 3.11

Project description

pprint3x

Version v3.10.4.6 as of 2023-07-14 see Changelog

build_badge codeql license jupyter pypi PyPI - Downloads black codecov Maintainability Maintainability Code Coverage snyk

Backport of pprint from Python 3.10.1 to Python 3.7-3.9**

The pertinent changes from Python 3.7 to Python 3.9 are:

  • pprint can now pretty-print types.SimpleNamespace. Contributed by Carl Bordum Hansenin Python 3.9.

  • pprint.pp has been added to pretty-print objects with dictionary keys being sorted with their insertion order by default. Parameter sort_dicts has been added to pprint.pprint, pprint.pformat and pprint.PrettyPrinter. Contributed by Rémi Lapeyre in Python 3.8.


automated tests, Github Actions, Documentation, Badges, etc. are managed with PizzaCutter (cookiecutter on steroids)

Python version required: 3.8.0 or newer

tested on recent linux with python 3.8, 3.9, 3.10, 3.11, 3.12-dev, pypy-3.9, pypy-3.10 - architectures: amd64

100% code coverage, flake8 style checking ,mypy static type checking ,tested under Linux, macOS, Windows, automatic daily builds and monitoring



Try it Online

You might try it right away in Jupyter Notebook by using the “launch binder” badge, or click here

Usage

to be compatible with the builtin module, just import pprint3x as follows:

>>> from pprint3x import pprint
>>> pprint('test')
'test'

or, if You need the full scope of the pprint namespace :

>>> import pprint3x as pprint
>>> pprint.pprint('test')
'test'
>>> pprint.isreadable('test')
True

for documentation of pprint itself, see : https://docs.python.org/3/library/pprint.html (select Python Version 3.10.1)

Usage from Commandline

there are no cli commands

Installation and Upgrade

  • Before You start, its highly recommended to update pip and setup tools:

python -m pip --upgrade pip
python -m pip --upgrade setuptools
  • to install the latest release from PyPi via pip (recommended):

python -m pip install --upgrade pprint3x
  • to install the latest release from PyPi via pip, including test dependencies:

python -m pip install --upgrade pprint3x[test]
  • to install the latest version from github via pip:

python -m pip install --upgrade git+https://github.com/bitranox/pprint3x.git
  • include it into Your requirements.txt:

# Insert following line in Your requirements.txt:
# for the latest Release on pypi:
pprint3x

# for the latest development version :
pprint3x @ git+https://github.com/bitranox/pprint3x.git

# to install and upgrade all modules mentioned in requirements.txt:
python -m pip install --upgrade -r /<path>/requirements.txt
  • to install the latest development version, including test dependencies from source code:

# cd ~
$ git clone https://github.com/bitranox/pprint3x.git
$ cd pprint3x
python -m pip install -e .[test]
  • via makefile: makefiles are a very convenient way to install. Here we can do much more, like installing virtual environments, clean caches and so on.

# from Your shell's homedirectory:
$ git clone https://github.com/bitranox/pprint3x.git
$ cd pprint3x

# to run the tests:
$ make test

# to install the package
$ make install

# to clean the package
$ make clean

# uninstall the package
$ make uninstall

Requirements

following modules will be automatically installed :

## Project Requirements
dataclasses; python_version < '3.7'

Acknowledgements

  • special thanks to “uncle bob” Robert C. Martin, especially for his books on “clean code” and “clean architecture”

Contribute

I would love for you to fork and send me pull request for this project. - please Contribute

License

This software is licensed under the MIT license

Changelog

  • new MAJOR version for incompatible API changes,

  • new MINOR version for added functionality in a backwards compatible manner

  • new PATCH version for backwards compatible bug fixes

v3.10.4.6

2023-07-14:
  • flake8

  • remove some tests for underscore numbers

v3.10.4.5

2023-07-14:
  • add codeql badge

  • move 3rd_party_stubs outside the src directory

  • add pypy 3.10 tests

  • add python 3.12-dev tests

v3.10.4.4

2023-07-13:
  • require minimum python 3.8

  • remove python 3.7 tests

v3.10.4.3

2023-07-13:
  • introduce PEP517 packaging standard

  • introduce pyproject.toml build-system

  • remove setup.cfg

  • remove setup.py

  • update black config

  • clean ./tests/test_cli.py

  • remove travis config

  • remove bettercodehub config

  • remove “better code” badges

  • remove python 3.6 tests

  • adding python 3.11 tests

  • update pypy tests to 3.9

v3.10.4.2

2022-06-02: update to github actions checkout@v3 and setup-python@v3

v3.10.4.1

2022-06-01: update github actions test matrix

v3.10.4

2022-03-25: fix github actions windows test

v3.10.3

2022-01-21: update documentation, again thanks to Ritvik Nag, https://github.com/rnag

v3.10.2

2022-01-20: remove unnecessary dependencies, thanks to Ritvik Nag, https://github.com/rnag

v3.10.1

2021-12-30: initial release

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

pprint3x-3.10.4.6.tar.gz (38.2 kB view details)

Uploaded Source

Built Distribution

pprint3x-3.10.4.6-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pprint3x-3.10.4.6.tar.gz.

File metadata

  • Download URL: pprint3x-3.10.4.6.tar.gz
  • Upload date:
  • Size: 38.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pprint3x-3.10.4.6.tar.gz
Algorithm Hash digest
SHA256 5c1f2041f4c098df7228f167c923f64605fc4ca14f08754405a7da4e7b7e9558
MD5 2ea8963476e666d69d39dc357b49ebd1
BLAKE2b-256 c305ddba5ef7043a6f8dfa19e3369b1df039051063f140b4fbae185d4e90487e

See more details on using hashes here.

File details

Details for the file pprint3x-3.10.4.6-py3-none-any.whl.

File metadata

  • Download URL: pprint3x-3.10.4.6-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pprint3x-3.10.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6bf1b27987fce51f9bda6f6f2f55382737885eb989d8203693b5241504788ac2
MD5 7a14036459cef21cb84c1e0fb795b7b2
BLAKE2b-256 190d95d99626b5e4432cbd4b22d3847bfa83befaab20a9c6af2d60d5b555802c

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