Skip to main content

Python Code Quality Utility with pycodestyle + autopep8 (120-character rule)

Project description

muthu-pyformatter

GitHub Repo GitHub License GitHub Forks GitHub Stars GitHub Contributors

Build Status PyPI Version Test PyPI Version

GitHub Image


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 --path argument (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)

  • pycodestyle
  • autopep8
  • colorama

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 .py files

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

muthu_pyformatter-0.0.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

muthu_pyformatter-0.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

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

Hashes for muthu_pyformatter-0.0.1.tar.gz
Algorithm Hash digest
SHA256 eba67c2fad4467d880ff816e98445c10c91337ac0fa737a2c415c7748f0cac96
MD5 5bbbf23cb53de4e18da382bb55df0548
BLAKE2b-256 20ba92d50ddaead70ce56a7b020839126e07b06689355d7bd8a31ec0bfc718b7

See more details on using hashes here.

File details

Details for the file muthu_pyformatter-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for muthu_pyformatter-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5d780131a94a1cf1ddcb284261ef62ae64f1139ba9757d61e0d40ebd985f297
MD5 63bcf74222721f7486fb4f46dcf3624f
BLAKE2b-256 2cf616158618b94a94f5f95c5dd19eb8369492fb0e229ed925da322ed19442ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page