flake8-plugin-utils
The package provides base classes and utils for flake8 plugin writing
What it is and what it does
flake8-plugin-utils is a framework for building flake8 linter plugins. It provides base classes (Error, Visitor, Plugin) that abstract away boilerplate code needed to integrate with flake8's plugin system, letting you focus on the AST traversal logic. The package includes testing utilities (assert_error, assert_not_error) to validate your plugin rules, configuration support for parameterizing plugin behavior, and helper functions for common AST operations like checking node equivalence and identifying literal values.
The package is designed for developers writing custom flake8 checkers. You define error types, implement visitor methods to detect violations, and the framework handles registration with flake8 and option parsing. It supports type-safe configuration through generics and includes utilities for comparing AST nodes, which is useful when your rules need to detect duplicate or equivalent code patterns.
Use it for:
- Build a custom flake8 plugin to enforce project-specific code style or naming conventions
- Create a linter plugin that detects anti-patterns or problematic code structures in your codebase
- Write a flake8 plugin that checks for security issues or compliance violations in Python code
- Test your flake8 plugin rules with pytest using the built-in assert_error and assert_not_error helpers
- Develop a plugin that requires configuration options, using the config system to parameterize checks
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides base classes and utilities for writing flake8 plugins, including Error, Visitor, and Plugin abstractions with built-in testing helpers and AST node utilities.
Yes, if you are writing a flake8 plugin. The package significantly reduces boilerplate and provides a clean API for plugin development. Dormant maintenance is acceptable here because the API is stable and unlikely to need frequent updates; flake8's plugin interface changes rarely. No known vulnerabilities. Low install friction and permissive license add no friction.
Install
flake8-plugin-utils on PyPI
pip
pip install flake8-plugin-utilsuv
uv add flake8-plugin-utilspoetry
poetry add flake8-plugin-utilsInstalling flake8-plugin-utils
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2023-06-26 and no commits since 2024-01-01—but the package is stable and widely used (961264 monthly downloads).
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
from flake8_plugin_utils import Error, Visitor, Plugin
class MyError(Error):
code = 'X100'
message = 'my error'
class MyVisitor(Visitor):
def visit_ClassDef(self, node):
self.error_from_node(MyError, node)
class MyPlugin(Plugin):
name = 'MyPlugin'
version = '0.1.0'
visitors = [MyVisitor]
Verify before relying
- Whether dormant maintenance status poses a risk for future Python or flake8 compatibility changes
- Whether the package is actively maintained despite no recent commits
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,145 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 961,264/month — #4,634 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flake8_plugin_utils-1.3.3-py3-none-any.whl
Keywords: flake8, plugin, utils
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
flake8-polyfillProvides compatibility helpers for Flake8…
permissive · top 5,000 on PyPI
flake8-returnA flake8 plugin that detects and flags…
permissive · top 15,000 on PyPI
flake8-printA flake8 plugin that detects print statements…
permissive · top 5,000 on PyPI
sensai-utilsProvides general-purpose utility classes…
permissive · top 15,000 on PyPI
flake8-class-attributes-orderA flake8 extension that enforces a configurable…
permissive · top 15,000 on PyPI
flake8-annotationsA Flake8 plugin that enforces PEP 3107-style…
permissive · top 15,000 on PyPI
flake8-pytest-styleA flake8 plugin that detects and reports style…
unclear · top 15,000 on PyPI
pep8-namingA flake8 plugin that checks Python code for…
permissive · top 5,000 on PyPI
flake8Flake8 is a command-line tool that combines…
permissive · top 1,000 on PyPI
izuluizulu provides a template-based,…
permissive · top 15,000 on PyPI