--- id: autopep8 version: "2.3.2" license: unclear license_treatment: permissive maintenance: active --- # autopep8 — A tool that automatically formats Python code to conform to the PEP 8 style guide License: permissive · Maintenance: active · Downloads: 10.6M/mo ## What it is and what it does autopep8 is a command-line tool that reads Python source files and automatically rewrites them to conform to the PEP 8 style guide. It uses pycodestyle to detect formatting violations—such as incorrect indentation, missing or extraneous whitespace, and improper comment spacing—then applies fixes without altering code logic or multiline string content. The tool operates in several modes: it can print diffs, modify files in place, process directories recursively, or read from stdin. It supports aggressive modes for non-whitespace changes, selective error fixing via include/exclude lists, and configuration via local or global pep8 config files. It's designed for developers who want automated style compliance without manual formatting work. Use it for: - Automatically reformat a codebase to meet PEP 8 standards before committing or deploying - Integrate into CI/CD pipelines to enforce consistent style across pull requests - Fix formatting violations reported by linters without manually editing each line - Recursively clean up style issues across an entire project directory - Apply selective fixes to only certain error categories while leaving others untouched ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. autopep8 automatically reformats Python code to comply with PEP 8 style rules, using pycodestyle to identify formatting violations and applying fixes across indentation, whitespace, and comment spacing. Yes. autopep8 is a stable, actively maintained tool with no known vulnerabilities, low install friction, and permissive licensing. It solves a concrete problem—automated PEP 8 compliance—and is suitable for any Python project that needs style enforcement. Install it if you want to automate formatting rather than enforce it via linting alone. ## Install pip install autopep8 uv add autopep8 poetry add autopep8 ## Installing autopep8 Before you install: Low install friction with a pure-Python wheel and only two runtime dependencies (pycodestyle and tomli). The project is actively maintained with recent commits and has been in production use since 2011, supporting current Python versions (3.9+). License in practice: Licensed under MIT (permissive), meaning you can use, modify, and distribute autopep8 freely with minimal restrictions—suitable for both open-source and proprietary projects. Quickstart: pip install autopep8 autopep8 --in-place --aggressive myfile.py Verify before relying: - Whether the tool can be integrated as a library (not just CLI) and what the programmatic API surface looks like - Performance characteristics when processing large codebases or running recursively across many files ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 10.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pep 8 code formatter, python style guide auto-fix, pycodestyle automatic fixer, python code reformatter, pep8 compliance tool, whitespace and indentation fixer, python formatting automation, code-formatter, pep8, style-automation [View on SkillFed](https://skillfed.io/packages/autopep8) · [View on PyPI](https://pypi.org/project/autopep8/)