$npx skillfedfor your agent

flake8-type-checking

A flake8 plugin for managing type-checking imports & forward references

Worth itPyPI Quality AssuranceReleased Feb 2026109.1K downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — flake8_type_checking-3.2.0-py3-none-any.whl
v3.2.0 · released 2026-02-18 · Python >=3.10 · 2 runtime deps: classify-imports, flake8

Yes. This is a focused, low-friction plugin that solves a real problem—unnecessary runtime import overhead and circular dependencies—with active maintenance, no security issues, and permissive licensing. Install it if you want automated guidance on moving type-only imports into TYPE_CHECKING blocks.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires flake8 to be installed and Python 3.10 or later.
  • Low friction install with just two runtime dependencies (flake8 and classify-imports).
  • The package is actively maintained with a recent release and supports current Python versions (3.10–3.14).

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause is a permissive license with no restrictions on use, modification, or distribution in proprietary or open-source projects.

last release 2026-02-18 (177 days) · last repo commit 2026-02-18 · 128 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 109,061 downloads/mo, #12,529 on PyPI

Verify before relying

pip install flake8-type-checking

# Add to .flake8 config:
# [flake8]
# extend-select = TC, TC2

# Then run flake8 as usual; the plugin will flag imports to move
  • Whether the plugin's inference works correctly with all pydantic, fastapi, cattrs, and injector patterns in real codebases.
  • Performance impact when running on large projects with many type-checking blocks.
Same gist for agents: .md · .json

What it is and what it does

This flake8 plugin analyzes your code to detect imports used only for type hints and suggests moving them into TYPE_CHECKING blocks. By guarding type-only imports behind TYPE_CHECKING, you eliminate their runtime overhead (important for large libraries like pandas), reduce circular import issues, and organize imports more cleanly. The plugin works by classifying imports as application, third-party, or built-in, then checking whether they're actually used at runtime or only in annotations.

It offers two strategies for handling forward references: TC100-range codes use postponed evaluation (from __future__ import annotations), while TC200-range codes use string literals. You configure which strategy suits your codebase and Python version target. The plugin includes special handling for frameworks like Pydantic and FastAPI, where class annotations are evaluated at runtime, and can be tuned with strict mode, exemptions, and custom typing module paths.

Use it for

  • Reduce import overhead in libraries that use heavy dependencies only for type hints (e.g., pandas, numpy).
  • Eliminate circular import errors by moving type-only imports into TYPE_CHECKING blocks.
  • Enforce consistent forward-reference style across a codebase (either future annotations or string literals).
  • Validate that Pydantic or FastAPI models don't incorrectly guard runtime-needed imports.
  • Organize and lint type-checking imports as part of your standard flake8 checks.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

This is a focused, low-friction plugin that solves a real problem—unnecessary runtime import overhead and circular dependencies—with active maintenance, no security issues, and permissive licensing. Install it if you want automated guidance on moving type-only imports into TYPE_CHECKING blocks.

Install

flake8-type-checking on PyPI

Before you install

Low friction install with just two runtime dependencies (flake8 and classify-imports). The package is actively maintained with a recent release and supports current Python versions (3.10–3.14).

Requires flake8 to be installed and Python 3.10 or later.

License in practice

BSD-3-Clause is a permissive license with no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

pip install flake8-type-checking

# Add to .flake8 config:
# [flake8]
# extend-select = TC, TC2

# Then run flake8 as usual; the plugin will flag imports to move

Verify before relying

  • Whether the plugin's inference works correctly with all pydantic, fastapi, cattrs, and injector patterns in real codebases.
  • Performance impact when running on large projects with many type-checking blocks.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
classify-importsflake8
MaintenanceActively maintained 177 days since the last release
Last repo commit
First released
Downloads109,061 / month, #12,529 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Quality AssuranceTyping :: Typed

Evidence: flake8_type_checking-3.2.0-py3-none-any.whl

Tags

Capabilities
flake8 type checking importsmove imports type checking blockreduce import overhead pythoncircular dependency importstype hint import lintingforward reference managementruntime import optimization
Topics
flake8-plugintype-checkingimport-optimization
PyPI keywords
flake8pluginlintingtype hinttypingimports

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 checking imports”

Give your agent the search over MCP, or paste the wish link into any chat.

More Quality Assurance packages

coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
ruff Worth it
PyPI · Python Modules · released Aug 2026

Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.

MITcompiled wheel · 3.7+
316.1Mdownloads / mo
pexpect With conditions
PyPI · Software Development · released Nov 2023

Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.

ISCpure Pythonaging
200.8Mdownloads / mo
black Worth it
PyPI · Python Modules · released May 2026

Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.

MITpure Python · 3.10+
179.9Mdownloads / mo
pytest-xdist Worth it
PyPI · Utilities · released Jul 2025

pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.

Install it if your test suite takes long enough that parallelization would save meaningful time.

MITpure Python · 3.9+
177.1Mdownloads / mo
cfn-lint Worth it
PyPI · Quality Assurance · released Aug 2026

Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.

Install it if you work with CloudFormation templates.

MIT-0pure Python
114.9Mdownloads / mo

See also flake8-typing-imports · flake8-annotations · flake8-pyi · flake8-tidy-imports · flake8-annotations-complexity · flake8-pep585 · flake8-import-order · flake8-isort · flake8-print · flake8-use-fstring