# autopep8

> Automatically reformats Python code to follow the PEP 8 style guide

Source: https://talira.ai/catalog/autopep8-868ephvm
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [developer tools / formatting](https://talira.ai/categories/developer-tools/formatting)
- Licence: MIT[^3]
- Pricing: Free and open source[^2]
- Pricing notes: Free and open source.
- Free tier: yes[^2]
- Backed by: [Hideo Hattori](https://talira.ai/orgs/hhatto.md)
- Extends: [VS Code](https://talira.ai/ecosystems/vscode.md#ext-xyq8t1bs)

A command-line tool and Python module that rewrites Python code to conform to PEP 8. It uses pycodestyle to find what needs fixing and can fix most of the formatting issues pycodestyle reports, in place or as a diff, with aggressive levels for larger changes such as wrapping long lines. Editors call it as a formatter, including through Microsoft's autopep8 extension for VS Code. MIT licensed.

## Links

- GitHub: https://github.com/hhatto/autopep8

## Problems it solves

- make my Python code follow PEP 8 automatically
- clean up messy Python formatting without changing what the code does
- fix the style warnings pycodestyle reports

## Features

- fixes most pycodestyle (PEP 8) formatting issues
- in-place edits or diffs
- aggressive levels for larger changes
- usable as a command or a Python module

## Limitations

- Requires pycodestyle[^1]

## Trust

Overall: 0.40 out of 1.
Signals: maintenance 0.27, adoption 0.73, momentum 0.42, community 0.73, backing 0.30, extensibility 0.00.

- latest release v2.3.2 22 months ago
- 4.7k GitHub stars
- 64 contributors
- backed by Hideo Hattori

Warnings:

- last commit 4 months ago

## Alternatives

- [Black](https://talira.ai/catalog/black-mgcvtq53.md): The uncompromising Python code formatter: one deterministic style, no configuration debates
- [Ruff](https://talira.ai/catalog/ruff-t1e35scd.md): An extremely fast Python linter and code formatter, written in Rust
- [YAPF](https://talira.ai/catalog/yapf-d00487g3.md): Configurable Python code formatter based on clang-format's algorithm

## Sources

[^1]: https://github.com/hhatto/autopep8#requirements (checked 24 Nov 2026)
[^2]: https://github.com/hhatto/autopep8 (checked 24 Nov 2026)
[^3]: https://github.com/hhatto/autopep8/blob/main/LICENSE (checked 24 Nov 2026)
