uncomment


Nameuncomment JSON
Version 2.6.0 PyPI version JSON
download
home_pageNone
SummaryA fast Rust-based CLI tool for removing comments from source code
upload_time2025-08-23 10:42:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords comments cli rust remove-comments code-cleanup ai-generated-code formatting uncomment
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # uncomment

[![PyPI version](https://badge.fury.io/py/uncomment.svg)](https://badge.fury.io/py/uncomment)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Goldziher/uncomment/blob/main/LICENSE)

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** - Supports Python, JS, TS, Rust, Go, Java, C/C++, and more
- 🔧 **Zero Dependencies** - Downloads a self-contained binary

## Installation

```bash
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:

```bash
uncomment main.py
```

Preview changes without modifying files:

```bash
uncomment --dry-run src/
```

Process all Python files in a directory:

```bash
uncomment "src/**/*.py"
```

## Key Features

### Smart Comment Detection

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

```python
# 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:**

```bash
uncomment generated_script.py
```

**Remove all comments including TODOs:**

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

**Remove docstrings:**

```bash
uncomment --remove-doc api.py
```

**Process entire packages:**

```bash
uncomment my_package/
```

**Use multiple threads for large codebases:**

```bash
uncomment --threads 8 entire_project/
```

## Supported Languages

While this tool works great for Python, it also supports:
JavaScript, TypeScript, Rust, Go, Java, C/C++, Ruby, YAML, Terraform/HCL, Makefile, and more!

## Documentation

For detailed documentation, advanced options, and examples, visit:
[https://github.com/Goldziher/uncomment](https://github.com/Goldziher/uncomment)

## License

MIT - see [LICENSE](https://github.com/Goldziher/uncomment/blob/main/LICENSE) for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "uncomment",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "comments, cli, rust, remove-comments, code-cleanup, ai-generated-code, formatting, uncomment",
    "author": null,
    "author_email": "Na'aman Hirschfeld <nhirschfeld@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/7b/7d/476584ed5d892aee0d9f67276216e3f0b1846a9ba36c20d5580a7fbc9c66/uncomment-2.6.0.tar.gz",
    "platform": null,
    "description": "# uncomment\n\n[![PyPI version](https://badge.fury.io/py/uncomment.svg)](https://badge.fury.io/py/uncomment)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Goldziher/uncomment/blob/main/LICENSE)\n\nA 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.\n\n## Why Use This?\n\n- \ud83d\ude80 **Lightning Fast** - Built in Rust for maximum performance\n- \ud83c\udfaf **100% Accurate** - Never accidentally removes code that looks like comments\n- \ud83d\udee1\ufe0f **Safe by Default** - Preview changes before applying them\n- \ud83c\udf0d **Multi-language** - Supports Python, JS, TS, Rust, Go, Java, C/C++, and more\n- \ud83d\udd27 **Zero Dependencies** - Downloads a self-contained binary\n\n## Installation\n\n```bash\npip install uncomment\n```\n\nThe installer will automatically download the appropriate pre-compiled Rust binary for your platform (Windows, macOS, or Linux).\n\n## Quick Start\n\nRemove comments from a single file:\n\n```bash\nuncomment main.py\n```\n\nPreview changes without modifying files:\n\n```bash\nuncomment --dry-run src/\n```\n\nProcess all Python files in a directory:\n\n```bash\nuncomment \"src/**/*.py\"\n```\n\n## Key Features\n\n### Smart Comment Detection\n\nUnlike simple regex-based tools, `uncomment` understands your code's structure:\n\n```python\n# This comment will be removed\ncode = \"# But this won't - it's in a string!\"\n```\n\n### Preserves Important Comments\n\nKeeps what matters:\n\n- `TODO` and `FIXME` comments (configurable)\n- License headers and copyright notices\n- Linting directives (`# noqa`, `# type: ignore`, etc.)\n- Docstrings (configurable)\n\n### Perfect for Python Projects\n\n- Handles all Python comment styles\n- Preserves type hints and annotations\n- Respects `# pylint:`, `# flake8:`, and other linter directives\n- Works with `.py`, `.pyw`, `.pyi`, `.pyx`, and `.pxd` files\n\n## Common Use Cases\n\n**Clean up AI-generated code:**\n\n```bash\nuncomment generated_script.py\n```\n\n**Remove all comments including TODOs:**\n\n```bash\nuncomment --remove-todo --remove-fixme module.py\n```\n\n**Remove docstrings:**\n\n```bash\nuncomment --remove-doc api.py\n```\n\n**Process entire packages:**\n\n```bash\nuncomment my_package/\n```\n\n**Use multiple threads for large codebases:**\n\n```bash\nuncomment --threads 8 entire_project/\n```\n\n## Supported Languages\n\nWhile this tool works great for Python, it also supports:\nJavaScript, TypeScript, Rust, Go, Java, C/C++, Ruby, YAML, Terraform/HCL, Makefile, and more!\n\n## Documentation\n\nFor detailed documentation, advanced options, and examples, visit:\n[https://github.com/Goldziher/uncomment](https://github.com/Goldziher/uncomment)\n\n## License\n\nMIT - see [LICENSE](https://github.com/Goldziher/uncomment/blob/main/LICENSE) for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A fast Rust-based CLI tool for removing comments from source code",
    "version": "2.6.0",
    "project_urls": {
        "Homepage": "https://github.com/Goldziher/uncomment",
        "Issues": "https://github.com/Goldziher/uncomment/issues",
        "Repository": "https://github.com/Goldziher/uncomment.git"
    },
    "split_keywords": [
        "comments",
        " cli",
        " rust",
        " remove-comments",
        " code-cleanup",
        " ai-generated-code",
        " formatting",
        " uncomment"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ff0c63515310e36d3f1aaed314a08f0eb723ff7d5df75e9bb351259b563ba09d",
                "md5": "d7169b822ee83a39bf586529264067a9",
                "sha256": "261a8d5fa72c532ba66ec975cb80767baddb6b3a159def205352f9b4c0b2bf47"
            },
            "downloads": -1,
            "filename": "uncomment-2.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d7169b822ee83a39bf586529264067a9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5220,
            "upload_time": "2025-08-23T10:42:57",
            "upload_time_iso_8601": "2025-08-23T10:42:57.529732Z",
            "url": "https://files.pythonhosted.org/packages/ff/0c/63515310e36d3f1aaed314a08f0eb723ff7d5df75e9bb351259b563ba09d/uncomment-2.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7b7d476584ed5d892aee0d9f67276216e3f0b1846a9ba36c20d5580a7fbc9c66",
                "md5": "50f69f4d2caa12d1a3e1856c38bff4bd",
                "sha256": "b7568dea04be5c675efde93392e71c23ccff77e43627f287a1538a3fa0db702f"
            },
            "downloads": -1,
            "filename": "uncomment-2.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "50f69f4d2caa12d1a3e1856c38bff4bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4759,
            "upload_time": "2025-08-23T10:42:58",
            "upload_time_iso_8601": "2025-08-23T10:42:58.615701Z",
            "url": "https://files.pythonhosted.org/packages/7b/7d/476584ed5d892aee0d9f67276216e3f0b1846a9ba36c20d5580a7fbc9c66/uncomment-2.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-23 10:42:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Goldziher",
    "github_project": "uncomment",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "uncomment"
}
        
Elapsed time: 1.69183s