Linters
What is pycodestyle? An introduction to PyCQA's Python style checker
pycodestyle is a simple Python style checker that checks code against some of the style conventions in PEP 8. The whole tool is contained in one Python file and needs only the standard library. It was formerly named pep8.
- Tool
- pycodestyle
- Made by
- PyCQA
- Official site
- github.com/PyCQA/pycodestyle
- Category
- Linters
Who makes pycodestyle
pycodestyle is maintained under PyCQA. The official website, which is the project's GitHub repository, is linked below.
Official website: github.com/PyCQA/pycodestyle
What pycodestyle is for
pycodestyle checks Python code against some of the style conventions in PEP 8. It focuses on style rather than program logic, so it reports where code departs from those conventions.
The project was renamed from pep8 to pycodestyle to reduce confusion. If you come across references to pep8 in older material, they refer to the same tool.
Who pycodestyle is for
The vendor does not state a specific audience. The tool suits Python developers who want to keep code consistent with PEP 8 and who prefer a small checker with no dependencies beyond the standard library.
Its parseable output also makes it practical for people who work in an editor and want to jump straight to each reported location.
Notable capabilities
pycodestyle keeps its scope narrow, and its documented capabilities reflect that focus on readable, inspectable style checks.
- PEP 8 checking: code is checked against some of the style conventions in PEP 8.
- Plugin architecture: new checks are easy to add.
- Parseable output: users can jump to the error location in an editor.
- Source and guidance display: it can show the source code for each error along with the relevant PEP 8 text.
- Statistics: it can display how often each error was found.
- Small footprint: it is a single Python file requiring only the standard library.
- Test suite: it comes with a comprehensive test suite.
- Installation with pip: it can be installed, upgraded and uninstalled with pip.
How pycodestyle fits linters
pycodestyle belongs to the linter category as a style-focused checker. It covers a defined slice of PEP 8 and leaves other kinds of analysis to different tools.
Within Linthelm's wider niche of linters, static analysis and code quality, it is the kind of tool that handles formatting and convention rules. Other tools look for likely bugs or measure complexity, and Prospector, covered separately on this site, brings pycodestyle together with other Python analysis tools.
A Debian/Ubuntu package exists, but it may not be the latest version. Installing with pip is the documented route for getting current releases.
Frequently asked questions
What is pycodestyle used for?
pycodestyle is used to check Python code against some of the style conventions in PEP 8. It can show the source for each error and the relevant PEP 8 text.
Was pycodestyle previously called pep8?
Yes. pycodestyle was formerly named pep8 and was renamed to reduce confusion.
How do I install pycodestyle?
It can be installed, upgraded and uninstalled with pip. A Debian/Ubuntu package also exists, but it may not be the latest version.
Does pycodestyle support plugins?
Yes. It has a plugin architecture that makes adding new checks easy.
Does pycodestyle have dependencies?
No dependencies beyond the standard library are needed. It is a single Python file.
Linthelm is independent and is not affiliated with PyCQA. Product names belong to their owners. Features change; confirm details on the official website.