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

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.1
File Actions
uncomment-3.12.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for uncomment-3.12.1-py3-none-win_amd64.whl
uncomment-3.12.1-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for uncomment-3.12.1-py3-none-manylinux_2_28_x86_64.whl
uncomment-3.12.1-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for uncomment-3.12.1-py3-none-manylinux_2_28_aarch64.whl
uncomment-3.12.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for uncomment-3.12.1-py3-none-macosx_11_0_arm64.whl
uncomment-3.12.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for uncomment-3.12.1-py3-none-macosx_10_12_x86_64.whl
uncomment-3.12.1-py3-none-any.whl Python 3 none any Details for uncomment-3.12.1-py3-none-any.whl

Total release size: 52.5 MB

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

Download URL uncomment-3.12.1-py3-none-win_amd64.whl
Size 10.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b9b9063642856c1e186e0fe95b1767f8581e554bdce74687d517c581c653d770
BLAKE2b-256 checksum
How to use checksums
e63d87102425ec8b268c568920e099ed15f776df3a77476b0c76c612ddad5c42
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.1-py3-none-manylinux_2_28_x86_64.whl

Download URL uncomment-3.12.1-py3-none-manylinux_2_28_x86_64.whl
Size 10.6 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b1074cffe27d72f5e3c29e76eb9d86f645c8e6b427e1114335482f46a958ad86
BLAKE2b-256 checksum
How to use checksums
5ed354fa7b0223474ea038a5de6024e8a7ce818dc22146cc305aed61b731dc49
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.1-py3-none-manylinux_2_28_aarch64.whl

Download URL uncomment-3.12.1-py3-none-manylinux_2_28_aarch64.whl
Size 10.4 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e585783dc1cb261959115cbd73d64b801ca6cc99114c5cc08680e448f736003e
BLAKE2b-256 checksum
How to use checksums
d375fe76473ef2ff0a7fb34956eff8123cb578b5bd377db47c93719cfdf12182
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.1-py3-none-macosx_11_0_arm64.whl

Download URL uncomment-3.12.1-py3-none-macosx_11_0_arm64.whl
Size 10.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
53eb670f12ac75b8672348a88275ad9938547539dbe2cda4d353c306e043bb20
BLAKE2b-256 checksum
How to use checksums
784953015398039172f3f291d16eaaa2928692fc048380acabd48c1a943f1cad
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.1-py3-none-macosx_10_12_x86_64.whl

Download URL uncomment-3.12.1-py3-none-macosx_10_12_x86_64.whl
Size 10.4 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7d71d303d25a6fc6d0373eeca0de3a389c5822c4f9ef586fc0cf867f7009ffac
BLAKE2b-256 checksum
How to use checksums
b3143b3c985f40d4ecd9d8695341a2cb7022fc01f6d92bace498bbf85cf27906
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.1-py3-none-any.whl

Download URL uncomment-3.12.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a5c40927d400ab3e84841d7fe12df68d28c206b1ecb7f53663aaa1d38ffdfe7
BLAKE2b-256 checksum
How to use checksums
456e6c9c0c7e4a16aa79f1a9aad952b4c6246ea5aedc2135f634bef155ce73a8
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.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

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

Select from 6 files

Attestation for uncomment-3.12.1-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.1 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