nprint
This is a module providing convenient functions to format, color and print any string to highlight any contained data structures.
It intends to replace the well known pprint, to format python objects on output
from nprint import nprint
data = {
'name': 'mydict',
'comment': 'this is a dictionnary',
'field': (5, 6),
'long one': [12324232, 53445645645, 'truc', 345345345345345356, (456,45), 'bla bla bla', 'blo blo blo', 'things and so'],
'some text': '/!\\ even content of strings are formated:\n {345, 23, 17, [2,1]} as you see\n',
}
installation
using pip:
pip install pnprint
or copy nprint.py from this repo to any directory you want !
functions provided:
-
nprint(*args, indent=0, color=True, end='\n')the pprint replacement: it works as
print()but works on strings instead of working on already known objectsit splits too long lines into indented blocks by syntax markers (such as
{}()[], etc)be careful: as
print,nprintuses the string conversionstr(obj)to convert an object passed, if you want to use the string representation, then you'll have to passrepr(obj)tonprintornformat -
nformat(text, indent=0, width=100) -> strsplit a text into indented lines
-
ncolor(text) -> stradd color makers for terminals syntax highlighting
-
deformat(text) -> strremove formatting of all marker-enclosed text
Metadata
Release files for pnprint 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pnprint-1.3.tar.gz | 5.2 kB | Without provenance | Details for pnprint-1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pnprint-1.3-py3-none-any.whl | Python 3 | none | any | Details for pnprint-1.3-py3-none-any.whl |
Total release size: 11.9 kB
Release files / pnprint-1.3.tar.gz
| Download URL | pnprint-1.3.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5129681f463914137b62f61124a8bda83eef4d31592bea38db569f9189106047
|
|
BLAKE2b-256 checksum How to use checksums |
9d73e4b8c7b3f7db0878989ec4fe6735369b1bfc995d676de762d6fe9bc75831
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.2 Linux/6.1.0-33-amd64
|
Release files / pnprint-1.3-py3-none-any.whl
| Download URL | pnprint-1.3-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
091eced168a39b372895b669f0b960bb8534469641660da20309baa986a60571
|
|
BLAKE2b-256 checksum How to use checksums |
07f2f8242cfb6e4d0d9663c4b028034a43f622b1269d0631d2bab3c2ff6b5a97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.2 Linux/6.1.0-33-amd64
|
Security for pnprint 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.