Skip to main content

uncomment

PyPI License: MIT

A blazing fast Rust-based command-line tool that removes comments from your source code. Perfect for cleaning up AI-generated code that comes with excessive explanations.

Why Use This?

  • 🚀 Lightning Fast - Built in Rust for maximum performance
  • 🎯 100% Accurate - Never accidentally removes code that looks like comments
  • 🛡️ Safe by Default - Preview changes before applying them
  • 🌍 Multi-language - 49 built-in languages, 306 available via tree-sitter-language-pack
  • 🔧 Zero Dependencies - Downloads a self-contained binary

Installation

pip install uncomment

The installer will automatically download the appropriate pre-compiled Rust binary for your platform (Windows, macOS, or Linux).

Quick Start

Remove comments from a single file:

uncomment main.py

Preview changes without modifying files:

uncomment --dry-run src/

Process all Python files in a directory:

uncomment "src/**/*.py"

Key Features

Smart Comment Detection

Unlike simple regex-based tools, uncomment understands your code's structure:

# This comment will be removed
code = "# But this won't - it's in a string!"

Preserves Important Comments

Keeps what matters:

  • TODO and FIXME comments (configurable)
  • License headers and copyright notices
  • Linting directives (# noqa, # type: ignore, etc.)
  • Docstrings (configurable)

Perfect for Python Projects

  • Handles all Python comment styles
  • Preserves type hints and annotations
  • Respects # pylint:, # flake8:, and other linter directives
  • Works with .py, .pyw, .pyi, .pyx, and .pxd files

Common Use Cases

Clean up AI-generated code:

uncomment generated_script.py

Remove all comments including TODOs:

uncomment --remove-todo --remove-fixme module.py

Remove docstrings:

uncomment --remove-doc api.py

Process entire packages:

uncomment my_package/

Use multiple threads for large codebases:

uncomment --threads 8 entire_project/

Supported Languages

While this tool works great for Python, it also supports: 49 built-in languages including JavaScript, TypeScript, Rust, Go, Java, C/C++, Ruby, Dockerfile, Scala, Dart, and many more. 306 total languages available via tree-sitter-language-pack.

Documentation

For detailed documentation, advanced options, and examples, visit: https://github.com/polylint/uncomment

polylint organization

uncomment is part of polylint, high-performance Rust linters and formatters built for agentic workflows. Sibling tools: polylint (one linter and formatter for every language; it can run uncomment as an engine), skif (JS/TS dependency linter), adrlint (MADR decision records). Install any of them from the Homebrew tap (brew tap polylint/tap) or the Scoop bucket.

License

MIT - see LICENSE for details.

Metadata

Release files for uncomment 3.11.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 uncomment 3.11.1
File Size Uploaded Provenance Actions
uncomment-3.11.1.tar.gz 5.2 kB With provenance Details for uncomment-3.11.1.tar.gz

Built distribution (wheel)

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

Total release size: 10.7 kB

Release files / uncomment-3.11.1.tar.gz

Download URL uncomment-3.11.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d1ac63e4e016c925e9d23377bf9457e78be027eb071a699ec27d8be75d210a2b
BLAKE2b-256 checksum
How to use checksums
027e65c692832af7d43aec89d883e03308abfa947783c8e69374e95e4af5eed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / uncomment-3.11.1-py3-none-any.whl

Download URL uncomment-3.11.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5c23e1a8a1fa0fad4e3bff3f7e14104c30398110a04ae6ea4a07ede050fd180
BLAKE2b-256 checksum
How to use checksums
00e31c239702a3feb08e55ee48eec54b4e4af1b336f754375f35f92bcc968ead
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for uncomment 3.11.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for uncomment-3.11.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

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

3.11.1 This release

2 release files Full 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