An open API service indexing awesome lists of open source software.

https://github.com/embernoglow/rust-demo---python-comments-remover-

Again Downloaded a python repository with 10k lines of comments and got confused? Remove them with the Comments Remover!
https://github.com/embernoglow/rust-demo---python-comments-remover-

application clean clean-code cleaner cmd comments demo developer-tools fast learning presentation-tools programming python regex rust string text tool useful utility

Last synced: 23 days ago
JSON representation

Again Downloaded a python repository with 10k lines of comments and got confused? Remove them with the Comments Remover!

Awesome Lists containing this project

README

          

# Comments Remover

Effortlessly clean up your Python code!

[![CC0](https://img.shields.io/badge/CC0-Public%20Domain-brightgreen)](https://creativecommons.org/publicdomain/zero/1.0/)
[![Rust](https://img.shields.io/badge/Rust-1.91-orange)](https://www.rust-lang.org/)
[![Cargo](https://img.shields.io/badge/cargo-red)](https://crates.io/)
[![GitHub Stars](https://img.shields.io/github/stars/EmberNoGlow/Rust-demo---Python-Comments-Remover-?style=social)](https://github.com/EmberNoGlow/Rust-demo---Python-Comments-Remover-/stargazers)

Comments Remover is a small, yet powerful, utility written in **Rust** for the primary purpose of **removing comments from Python scripts**. Whether you're decluttering a large codebase, preparing code for presentations, or simply want a cleaner view of the logic, this tool is designed to help.

### Purpose & Technology

* **Educational Focus:** Developed with education in mind, this project demonstrates practical application of string manipulation and regular expressions in Rust.
* **Implementation:** The tool is built entirely in Rust and leverages the power of **Regular Expressions (Regex)** to accurately identify and remove various comment types.
* **Supported Comment Types:**
* Single-line comments (`# ...`)
* Multi-line string literals used as comments (`""" ... """` and `''' ... '''`)

### Why Use Comments Remover?

* **Improved Readability:** Focus on the core Python logic without the distraction of comments.
* **Code Streamlining:** Quickly prepare code for sharing, documentation, or specific processing steps.
* **Learning Rust:** A hands-on example of building a command-line utility in Rust.

### Getting Started

#### Building the Project

To build the Comments Remover yourself, you'll need Rust and Cargo installed.
1. Clone this repository:
```bash
git clone https://github.com/EmberNoGlow/Rust-demo---Python-Comments-Remover-.git
cd comments-remover
```
2. Compile the project:
```bash
cargo build
```

#### Using Pre-compiled Binaries

For immediate use, you can download a pre-compiled executable from the [releases](https://github.com/EmberNoGlow/Rust-demo---Python-Comments-Remover-/releases) page of this repository.

### Run
Compile and run the program. You'll see a command prompt waiting to enter the path to your python script where you want to remove comments. Paste the path, and then he will ask for the path to save the file. Specify it. Press enter. If everything went well, the program will display "Success", close, and you will have a clean python file without comments!

### License

This project is proudly licensed under the **Creative Commons Zero (CC0) License**.
This means you can use, copy, modify, distribute, and perform the work, even for commercial purposes, all without asking permission. It's dedicated to the public domain.

---