Skip to main content

prindent

Python module to print with automatic indentation

Sometimes it is useful to print with indentation to better visualize the data. This is particularly true when multiple for loops and if statements are nested. prindent can automatically indent everything for you.

Usage

from prindent import prindent

prindent('first loop')
for i in range(2):
    prindent('i:', i)
    prindent('second loop')
    for j in range(2):
        prindent('j:', j)
        if j == 1:
            prindent('j=1')

# first loop
#     i: 0
#     second loop
#         j: 0
#         j: 1
#             j=1
#     i: 1
#     second loop
#         j: 0
#         j: 1
#             j=1

prindent supports custom indentation strings:

if True:
    if True:
        for i in range(2):
            prindent('Custom indent', indent='---> ')

# ---> ---> ---> Custom indent
# ---> ---> ---> Custom indent

prindent handles multiple lines:

if True:
    prindent('String\nwith\nnewline')

#     String
#     with
#     newline

prindent accepts multiple args and kwargs just like print():

if True:
    prindent('first', 'second', end='$')

#     first second$

Metadata

Release files for prindent 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prindent 1.0.1
File Size Uploaded Provenance Actions
prindent-1.0.1.tar.gz 14.4 kB Without provenance Details for prindent-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prindent 1.0.1
File Interpreter ABI Platform Actions
prindent-1.0.1-py3-none-any.whl Python 3 none any Details for prindent-1.0.1-py3-none-any.whl

Total release size: 28.7 kB

Release files / prindent-1.0.1.tar.gz

Download URL prindent-1.0.1.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
689798671efcbd04111a4f4a33de4bb8f1f3de0ceb77be0c9d809d15801c4652
BLAKE2b-256 checksum
How to use checksums
fdaa7e313b3b9b3d18b44f1658af26f57db6a96ad01b18a9e7e14380c9214df3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / prindent-1.0.1-py3-none-any.whl

Download URL prindent-1.0.1-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
404572843076d604cd0ffd38a707f0851204614965599c112c6c6446609e5749
BLAKE2b-256 checksum
How to use checksums
7729fbab8c233ad0d80016f835d8757b32ee4e60c5158a2afe2e01a615dac3ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for prindent 1.0.1

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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page