Skip to main content

A Python package to remove comments from Python code.

Project description

📜 CommentBeGone

Do you have too many comments? Can’t see the forest for the comments? Or maybe your code is as chatty as that one friend who always leaves voice notes? Introducing CommentBeGone – the revolutionary Python package that puts your comments in their place: nowhere.

Why CommentBeGone?

Let’s face it – comments are great, until they aren’t:

  • Too many “I’ll explain this later” notes? Later is now.
  • Confusing inline comments? Your if statements deserve a little peace and quiet.
  • Random comments in YAML files that aren’t helping anyone? Say goodbye.

With CommentBeGone, your code can finally look as mysterious as you always wanted it to be!

What It Does

CommentBeGone purges comments from your Python and YAML files so you can send cleaner code to your coworkers, or impress hiring managers with a mysterious sense of minimalism.

Install

pip install commentbegone

Requires Python 3.8+. Will probably not work on ancient computers or quantum systems.

Usage

Want to rid your file of those pesky comments? Just call CommentBeGone from the command line.

commentbegone your_code.py no_more_comments.py

Or for YAML files:

commentbegone configs.yaml clean_configs.yaml

Poof! Your comments are gone, and your file is ready for a quieter tomorrow.

Advanced Example

Let’s say you have a file, chatty_code.py, with this noisy mess:

# This function adds two numbers
def add(a, b):
    return a + b  # Returns the sum of two numbers, obviously

Just run:

commentbegone chatty_code.py silent_code.py

And in silent_code.py you’ll find:

def add(a, b):
    return a + b

Pure, mysterious code – just like nature intended.

How It Works

"How does it know the difference between escaped and unescaped hashes?" –You

Good question! CommentBeGone uses regex sorcery to differentiate real comments from innocent hashes. We make sure those escaped # symbols in strings stay untouched. It’s a magical balance of regex and Python wizardry.

Contributing

Found a way to silence even more comments? Or maybe you’ve written some code that needs more comments removed? Either way, submit a PR, open an issue, or shout into the void – we might hear you.

License

MIT – use responsibly. (No, it won’t work on your boss’s emails.)


Enjoy a quieter codebase with CommentBeGone – because code is meant to be read... by the very brave.

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

commentbegone-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

commentbegone-1.0.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file commentbegone-1.0.0.tar.gz.

File metadata

  • Download URL: commentbegone-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for commentbegone-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fb62cf4a3e07980f21bcdb48a5729429ea56551f35f8afce1a9ee463984d901c
MD5 fe78614dba4d4bfaf360c36ed7bcf24c
BLAKE2b-256 6c84c5d7b026f4a1ae60826feac1ce2568c4e615055b99f21d30cbf5ece41eb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for commentbegone-1.0.0.tar.gz:

Publisher: python-publish.yml on nityaranjan22/CommentBeGone

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file commentbegone-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: commentbegone-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for commentbegone-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44e7a2216d0b5d40b03c933e78cca7484d9bf8408a059a19a1ff36cbd71c0894
MD5 51aed7b0d9bf6bdaf3930018a643d294
BLAKE2b-256 b8a59a474e3e681f9ef27be241489dee9ad9f9599377c892369055ffe90dc3e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for commentbegone-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on nityaranjan22/CommentBeGone

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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