Python Code Quality Utility with pycodestyle + autopep8 (120-character rule)
Project description
muthu-pyformatter
A lightweight Python code-quality utility that checks PEP8 compliance using pycodestyle and auto-formats code using autopep8, enforcing a strict 120-character line limit.
✨ Features
- ✔ Scans all Python files in any directory
- ✔ Enforces max line length = 120
- ✔ Automatically fixes code formatting using
autopep8 - ✔ Shows detailed style errors using
pycodestyle - ✔ Supports custom
--pathargument (defaults to current directory) - ✔ Works on Windows, Linux, and macOS
📦 Installation
1️⃣ Install via PyPI (recommended)
pip install muthu-pyformatter
2️⃣ Clone the repository (optional / development)
git clone https://github.com/kumarmuthu/muthu-pyformatter
cd muthu-pyformatter
▶️ Usage
CLI via PyPI
Check and auto-format Python files in a directory:
muthu-pyformatter --path "C:\users\kumar\repo\"
or on Linux/macOS:
muthu-pyformatter --path ./src
Using Python module (Git clone / development)
python -m muthu_pyformatter.formatter --path "C:\users\kumar\repo\"
or on Linux/macOS:
python3 -m muthu_pyformatter.formatter --path ./src
🧰 What the Script Does
1️⃣ Installs required tools (if missing)
pycodestyleautopep8colorama
2️⃣ Runs pycodestyle
- Detects PEP8 violations
- Enforces 120-character limit
- Prints all issues
3️⃣ Runs autopep8
- Auto-formats Python files
- Fixes spacing, indentation, blank lines
- Recursively processes all
.pyfiles
4️⃣ Re-runs pycodestyle to validate fixes
📁 Script File Name
muthu_pyformatter/formatter.py
or via CLI after PyPI install:
muthu-pyformatter
📝 License
MIT License Feel free to use, modify, and contribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file muthu_pyformatter-0.0.1.tar.gz.
File metadata
- Download URL: muthu_pyformatter-0.0.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eba67c2fad4467d880ff816e98445c10c91337ac0fa737a2c415c7748f0cac96
|
|
| MD5 |
5bbbf23cb53de4e18da382bb55df0548
|
|
| BLAKE2b-256 |
20ba92d50ddaead70ce56a7b020839126e07b06689355d7bd8a31ec0bfc718b7
|
File details
Details for the file muthu_pyformatter-0.0.1-py3-none-any.whl.
File metadata
- Download URL: muthu_pyformatter-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5d780131a94a1cf1ddcb284261ef62ae64f1139ba9757d61e0d40ebd985f297
|
|
| MD5 |
63bcf74222721f7486fb4f46dcf3624f
|
|
| BLAKE2b-256 |
2cf616158618b94a94f5f95c5dd19eb8369492fb0e229ed925da322ed19442ff
|