Skip to main content

A simple tool to comment or uncomment all print() statements in Python projects.

Project description

🧹 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.


🌐 Links


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

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

pyprint_cleaner-1.2.4.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyprint_cleaner-1.2.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pyprint_cleaner-1.2.4.tar.gz.

File metadata

  • Download URL: pyprint_cleaner-1.2.4.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for pyprint_cleaner-1.2.4.tar.gz
Algorithm Hash digest
SHA256 e039233e5af5cd76e324b1a9df187125f5919ce260171202aabf55478ec33410
MD5 0508c771c7c926130af0ea7d540adaf8
BLAKE2b-256 f5b3a3dc690e2d46307584fbb44998b673c1dfbe3cd39433e14f06caeb66eb36

See more details on using hashes here.

File details

Details for the file pyprint_cleaner-1.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pyprint_cleaner-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0df9c810fb5d5090bc8cba4787e7f6ea2aa719c83ff7490b2e7bc1ba644edda9
MD5 8fb1942d748293690167ba616194f8b7
BLAKE2b-256 bae03657853dba6a940cb1398d7a8b7bcf09b7d081b56e22a11ddfd52216c2ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page