Skip to main content

🧹 pyprint-cleaner

pyprint-cleaner is a simple yet powerful developer utility that automatically comments out or uncomments all print() statements in your Python project.

This helps you keep your production code clean while easily restoring debug logs when needed.


🚀 Features

✅ Recursively scan your entire project for print() statements
✅ Automatically comment them out safely with backups
✅ Revert them anytime with one command
✅ Never touches your docstrings or existing comments
✅ CLI support (comment-prints and uncomment-prints)
✅ Cross-platform and zero dependencies


🧰 Installation

pip install pyprint-cleaner

🧩 Usage

Comment all print() statements

comment-prints

You’ll be prompted for your project directory.
Each modified file gets a .bak backup for safety.


Uncomment previously commented prints

uncomment-prints

Restores all lines previously commented by pyprint-cleaner (lines starting with # [auto] print(...)).


💡 Example

Before:

print("Debug start")
for i in range(5):
    print(i)
# print("already commented")

After running comment-prints:

# [auto] print("Debug start")
for i in range(5):
    # [auto] print(i)
# print("already commented")

After running uncomment-prints:

print("Debug start")
for i in range(5):
    print(i)
# print("already commented")

⚙️ Command-Line Shortcuts

Command Description
comment-prints Comment all print statements
uncomment-prints Restore all commented prints

🧑‍💻 Author

Syed Rakesh Uddin
Python Developer & Automation Enthusiast


📜 License

This project is licensed under the MIT License — see the LICENSE file for details.



✨ Keep your codebase clean, your console quieter, and your debugging reversible!

Metadata

Release files for pyprint-cleaner 1.2.5

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

Source distribution (sdist)

Source distribution for pyprint-cleaner 1.2.5
File Size Uploaded Provenance Actions
pyprint_cleaner-1.2.5.tar.gz 6.0 kB Without provenance Details for pyprint_cleaner-1.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyprint-cleaner 1.2.5
File Interpreter ABI Platform Actions
pyprint_cleaner-1.2.5-py3-none-any.whl Python 3 none any Details for pyprint_cleaner-1.2.5-py3-none-any.whl

Total release size: 13.2 kB

Release files / pyprint_cleaner-1.2.5.tar.gz

Download URL pyprint_cleaner-1.2.5.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9a81b684d95b6f674fac494d075215511052b2069fe6c61697f80ddcdb3dead2
BLAKE2b-256 checksum
How to use checksums
53c4984e402b0a32cb5521d024f45458d7ab4a5ec5708ad994b21418b4c3a4a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / pyprint_cleaner-1.2.5-py3-none-any.whl

Download URL pyprint_cleaner-1.2.5-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebfd80125e25789f28322e50a39aff487091b2aa5297d55a4aaf84a9799f6230
BLAKE2b-256 checksum
How to use checksums
e11cac085c02ac5cb3ef1590824ac3b7fa38dd5d6577e59fd650a5a4ca83bdef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for pyprint-cleaner 1.2.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.

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