flake8-annotations-complexity
A flake8 extension that checks for type annotations complexity
Decision gist · record as of 2026-08-14
Yes. The plugin is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and adds minimal install friction (only flake8 as a dependency). It solves a real code-quality problem—catching overly complex type annotations—and integrates seamlessly into existing flake8 workflows. Install it if your team values readable, maintainable type hints.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; flake8 must be installed and configured.
- Low friction: pure Python wheel with only flake8 as a runtime dependency.
- Actively maintained as of 2026-08-14 with no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open and closed projects.
last release 2026-08-14 (0 days) · last repo commit 2026-08-14 · 50 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 332,768 downloads/mo, #7,505 on PyPI
Alternatives
Verify before relying
pip install flake8-annotations-complexity
# In your flake8 config or command line:
flake8 --max-annotations-complexity=3 --max-annotations-len=7 mycode.py
# Reports TAE002 (nesting too deep) and TAE003 (too many elements)- Whether the plugin integrates seamlessly with existing flake8 configurations and CI/CD pipelines.
- Performance impact on large codebases with many type annotations.
What it is and what it does
flake8-annotations-complexity is a flake8 extension that measures and enforces limits on type annotation complexity. It defines complexity as the maximum nesting level of type brackets—for example, `List[int]` has complexity 2, while `Tuple[List[Optional[str]], int]` has complexity 4. The plugin checks annotations on function arguments (positional, keyword-only, *args, **kwargs), return types (including async functions), and annotated variable assignments.
The plugin provides two checks: TAE002 flags annotations exceeding a nesting-depth threshold (default 3), and TAE003 flags annotations with too many elements (default 7). Both thresholds are configurable via flake8 command-line options. It runs on Python 3.10 through 3.14 and integrates directly into your existing flake8 workflow, making it easy to catch overly complex type hints during development or CI.
Use it for
- Enforce a team style guide that discourages deeply nested generics like `Dict[str, List[Tuple[int, Optional[str]]]]` in code review.
- Catch annotation mistakes early—complex annotations often signal bad decomposition or wrong data structure choices.
- Improve code readability by flagging annotations that are hard to parse at a glance.
- Prevent Java-like verbosity in Python type hints during refactoring or new feature development.
- Integrate into CI/CD pipelines to maintain consistent annotation standards across a project.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The plugin is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and adds minimal install friction (only flake8 as a dependency). It solves a real code-quality problem—catching overly complex type annotations—and integrates seamlessly into existing flake8 workflows. Install it if your team values readable, maintainable type hints.
Install
flake8-annotations-complexity on PyPI
Before you install
Low friction: pure Python wheel with only flake8 as a runtime dependency. Actively maintained as of 2026-08-14 with no known vulnerabilities.
Requires Python 3.10 or later; flake8 must be installed and configured.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open and closed projects.
Quickstart
pip install flake8-annotations-complexity
# In your flake8 config or command line:
flake8 --max-annotations-complexity=3 --max-annotations-len=7 mycode.py
# Reports TAE002 (nesting too deep) and TAE003 (too many elements)
Verify before relying
- Whether the plugin integrates seamlessly with existing flake8 configurations and CI/CD pipelines.
- Performance impact on large codebases with many type annotations.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageflake8 |
| Maintenance | Actively maintained 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 332,768 / month, #7,505 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 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: DocumentationTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance |
Evidence: flake8_annotations_complexity-0.2.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 type annotation complexity”
- flake8-annotations-complexityA flake8 plugin that flags type annotations exceeding configurable…
- flake8-annotationsA Flake8 plugin that enforces PEP 3107-style function type…
- flake8-pyiA Flake8 plugin that lints Python type stub files (.pyi) with…
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-class-attributes-order · flake8-expression-complexity · flake8-functions · flake8-cognitive-complexity · cognitive-complexity · code-annotations · flake8-type-checking · flake8-annotations · mccabe · flake8-variables-names