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
  • 🔧 Self-contained - Platform wheels ship the prebuilt binary; nothing is downloaded at install time

Installation

pip install uncomment

How the binary gets here

  1. Platform wheel (primary). Each release publishes one wheel per platform with the prebuilt binary inside, so pip installs it with no further download (it works offline and in sandboxes) and the wheel hash pip verifies covers the binary:

    Platform Wheel tag
    macOS (Apple silicon) macosx_11_0_arm64
    macOS (Intel) macosx_10_12_x86_64
    Linux arm64 (glibc 2.28+) manylinux_2_28_aarch64
    Linux x64 (glibc 2.28+) manylinux_2_28_x86_64
    Windows x64 win_amd64
  2. Download (fallback). On any other host pip picks the pure-Python py3-none-any wheel, which carries no binary: the first run downloads the release archive for the host from GitHub into ~/.cache/uncomment/<version>/. Set UNCOMMENT_BINARY to use a binary you already have. pip always prefers a matching platform wheel.

There is no source distribution.

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

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

Built distributions (wheels)

Table of built distributions (wheels) for uncomment 3.12.0
File Actions
uncomment-3.12.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for uncomment-3.12.0-py3-none-win_amd64.whl
uncomment-3.12.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for uncomment-3.12.0-py3-none-manylinux_2_28_x86_64.whl
uncomment-3.12.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for uncomment-3.12.0-py3-none-manylinux_2_28_aarch64.whl
uncomment-3.12.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for uncomment-3.12.0-py3-none-macosx_11_0_arm64.whl
uncomment-3.12.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for uncomment-3.12.0-py3-none-macosx_10_12_x86_64.whl
uncomment-3.12.0-py3-none-any.whl Python 3 none any Details for uncomment-3.12.0-py3-none-any.whl

Total release size: 59.1 MB

Release files / uncomment-3.12.0-py3-none-win_amd64.whl

Download URL uncomment-3.12.0-py3-none-win_amd64.whl
Size 13.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
110854e8de3f22f07f34cc647622d89ce31984a74664afa6d5fbec9764d14a80
BLAKE2b-256 checksum
How to use checksums
9a8e73b566002ff8795e1d7124129bdaec2c60f75f1feed1718aa4b9e039b57e
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.12.0-py3-none-manylinux_2_28_x86_64.whl

Download URL uncomment-3.12.0-py3-none-manylinux_2_28_x86_64.whl
Size 11.5 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d9dcbb94150dd800b2a20d59c007d12f8ecef26590d6900acb96cd366575f6a9
BLAKE2b-256 checksum
How to use checksums
85753ca8fc5ac88f9c07943b1c8164978aa99fa5f2bd334a18aaffee005bcf23
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.12.0-py3-none-manylinux_2_28_aarch64.whl

Download URL uncomment-3.12.0-py3-none-manylinux_2_28_aarch64.whl
Size 11.4 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f23d54aea59f60c86786104ed9bb4248bbc18a95bf16f3e7218ccd60ed9de10e
BLAKE2b-256 checksum
How to use checksums
6a43cf46778486caf5ae8808ee07af678b463f7665ee3bf903a28afa9e649a51
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.12.0-py3-none-macosx_11_0_arm64.whl

Download URL uncomment-3.12.0-py3-none-macosx_11_0_arm64.whl
Size 11.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d1efb08adaa9e9551f29cc3f371d0dbe541d4b725c8248e48053ee7752663b45
BLAKE2b-256 checksum
How to use checksums
06387a8262ab5cb6dee7795cc8ae6188aa916c574eba1d7d72769e3e03c6d137
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.12.0-py3-none-macosx_10_12_x86_64.whl

Download URL uncomment-3.12.0-py3-none-macosx_10_12_x86_64.whl
Size 11.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0da8ac17e5a2b7906eabc5b4007603e21947cd2b5f8d949089c377ab82d8bf71
BLAKE2b-256 checksum
How to use checksums
d5535e7d438ea3c1bb997c1d7d30a5a7354da9ba3e0373ea3c0e93af940e4a7c
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.12.0-py3-none-any.whl

Download URL uncomment-3.12.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96aabba78363e9ce2a6ab8f637c6b8ec0b98ef8f376d3227534bbda9e5389d72
BLAKE2b-256 checksum
How to use checksums
2b084506efbd1ed38ad9a5464ee0bd2225cb3e5ef4a4b7077b3c1e47667d0692
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.12.0

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

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for uncomment-3.12.0-py3-none-win_amd64.whl

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.12.0 This release

6 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