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.0.2.tar.gz (3.9 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.0.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyprint_cleaner-1.0.2.tar.gz
  • Upload date:
  • Size: 3.9 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.0.2.tar.gz
Algorithm Hash digest
SHA256 15fe50649c27379fdc460a8e7ebd620ca82adc5c3feaad733dfabe4c4e6bb6a3
MD5 55913b2d1b33cb6ed39efe5a1dbf227f
BLAKE2b-256 e9e294295232dddcce7a378cb0d123135e2b3781d5174c1a91802a7425a71b24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyprint_cleaner-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0476f8739c651b89bbab4a6435b71d8ba979d4682680d4cd8ac2e9216a751ac6
MD5 d29482e7090b2f461406c57aa1a80206
BLAKE2b-256 30a1f2369c0f052489f991b0a3e776faedf611d6cd8e8164c080374263730408

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