flake8-class-attributes-order
A flake8 extension that checks classes attributes order
Decision gist · record as of 2026-08-14
Yes, if you value consistent class organization and your team can tolerate aging maintenance. The plugin is stable, has no known vulnerabilities, and solves a real code-style problem. However, verify compatibility with your current flake8 version before adopting. Best suited for teams that already use flake8 and want to standardize class layouts.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later and an existing flake8 installation.
- Installs with minimal friction—only two runtime dependencies (flake8 and typing-extensions).
- Maintenance is aging: last release was 512 days ago, though the repository remains active with a recent commit.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with only attribution required. No licensing restrictions on commercial or private projects.
last release 2025-03-20 (512 days) · last repo commit 2025-03-20 · 60 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 363,191 downloads/mo, #7,226 on PyPI
Alternatives
Verify before relying
pip install flake8-class-attributes-order
# Then run flake8 on your code:
flake8 your_file.py
# Configure in setup.cfg or .flake8:
# [flake8]
# use_class_attributes_order_strict_mode = True- Whether the aging maintenance status affects compatibility with the latest flake8 versions.
- Performance impact on large codebases with many classes.
What it is and what it does
This package is a flake8 plugin that validates the internal structure of Python classes by enforcing a consistent order for attributes, methods, and nested elements. It recognizes different attribute types—docstrings, properties, static methods, class methods, nested classes, constants, fields, and regular methods—and checks that they appear in a defined sequence. By default it expects `__new__` and `__init__` first, followed by other magic methods, then properties, static methods, class methods, and regular methods, with protected and private variants ordered separately.
Beyond ordering, it also detects class-level logic (like conditional expressions or attribute modifications) that should typically live in `__init__` instead. The tool is configurable: you can use a strict mode that separates protected and private variants into their own sections, or manually define your own attribute order. It reports violations as CCE001 (wrong order) and CCE002 (class-level expression) errors that integrate into your flake8 workflow.
Use it for
- Enforce consistent class structure across a large codebase to improve readability and maintainability.
- Catch Django model fields and methods that are out of conventional order in model definitions.
- Detect class-level logic (e.g., widget configuration) that belongs in `__init__` but was placed at class scope.
- Validate that nested classes like `Meta` appear in the expected position within their parent class.
- Integrate class-structure validation into CI/CD pipelines alongside other flake8 checks.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you value consistent class organization and your team can tolerate aging maintenance.
The plugin is stable, has no known vulnerabilities, and solves a real code-style problem. However, verify compatibility with your current flake8 version before adopting. Best suited for teams that already use flake8 and want to standardize class layouts.
Install
flake8-class-attributes-order on PyPI
Before you install
Installs with minimal friction—only two runtime dependencies (flake8 and typing-extensions). Maintenance is aging: last release was 512 days ago, though the repository remains active with a recent commit.
Requires Python 3.9 or later and an existing flake8 installation.
License in practice
MIT license permits unrestricted use, modification, and distribution with only attribution required. No licensing restrictions on commercial or private projects.
Quickstart
pip install flake8-class-attributes-order
# Then run flake8 on your code:
flake8 your_file.py
# Configure in setup.cfg or .flake8:
# [flake8]
# use_class_attributes_order_strict_mode = True
Verify before relying
- Whether the aging maintenance status affects compatibility with the latest flake8 versions.
- Performance impact on large codebases with many classes.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesflake8typing-extensions |
| Maintenance | Aging 512 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 363,191 / month, #7,226 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: ConsoleFramework :: Flake8Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: DocumentationTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance |
Evidence: flake8_class_attributes_order-0.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “flake8 class attribute order”
- flake8-class-attributes-orderA flake8 extension that enforces a configurable order for class…
- flake8-import-orderA flake8 plugin that enforces import ordering and grouping according…
- flake8-loggingA Flake8 plugin that detects and flags common mistakes in Python's…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also flake8-annotations-complexity · pep8-naming · abstractcp · flake8-functions · flake8-plugin-utils · overrides · flake8-unused-arguments · flake8-annotations · flake8-expression-complexity · flake8-pie