smartprint
Save a few seconds and a few keystrokes with every print statement! 😎
Usual print statment:
print ("veryLongVariableName : ", veryLongVariableName)
Enter smart print:
from smartprint import smartprint as sprint
veryLongVariableName = 25
sprint (veryLongVariableName)
Output:
veryLongVariableName : 25
Examples:
1. smartprint works with multiple variables and different kinds of objects
from smartprint import smartprint as sprint
import numpy as np
a = [1,22,31]
sprint (a, len(a))
sprint (np.random.rand())
Output:
a, len(a) : [1, 22, 31] 3
np.random.rand() : 0.649617730484109
2. smartprint includes pretty print (through pprint module and colored prints through rich module) for lists and dicts as shown below:
2 (a) List example
d = {-1:"dictionaries", 0: "are", 100:"keys", "boolean":[True, False],
6:"printed", 50:" with sorted", "Nishant":"Kumar", \
"numbers":[1,100,-2000,12]}
sprint (d)
Output:
In place print replacement
As suggested by user @nickdelgrosso in Issue 7, if
from smartprint import smartprint as print
is used, smartprint can be used as an in-place print replacement. Alternatively, it can be used to override the existing print statements without touching any other parts of the code.
Installation
pip install smartprint
Issues
Please feel free to start a pull request/ raise an issue.
Code coverage plot
Metadata
Release files for smartprint 1.0.5
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 |
|---|---|---|---|---|
| smartprint-1.0.5.tar.gz | 3.8 kB | Without provenance | Details for smartprint-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smartprint-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for smartprint-1.0.5-py3-none-any.whl |
Total release size: 7.7 kB
Release files / smartprint-1.0.5.tar.gz
| Download URL | smartprint-1.0.5.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0be8e0c6e95aa7d6f8bf0a5cf8e75923c034562cb0f4b916262683dab5b03ad0
|
|
BLAKE2b-256 checksum How to use checksums |
7a4b68b76d1e092b843d0a037caedd54ef8875df0a3d57d4083eabf060f1def4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / smartprint-1.0.5-py3-none-any.whl
| Download URL | smartprint-1.0.5-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f9d937bae02073932f01cce8f7bec1527daced978b1565a8267f6c7166c8f99
|
|
BLAKE2b-256 checksum How to use checksums |
cf04db8b8a23f6a00430e1f8987aaa7184b0fcdd07a1fdf540aee331f0f419fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Security for smartprint 1.0.5
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.