flake8-async
A highly opinionated flake8 plugin for Trio-related problems.
What it is and what it does
flake8-async is a flake8 plugin that integrates async-specific linting rules for Trio, AnyIO, and asyncio code. It detects a range of issues from outright bugs to idiom violations that may signal misunderstandings of async patterns. The plugin reports problems using ASYNC-prefixed error codes and is designed to catch issues that general linters might miss in async contexts.
The plugin depends on libcst for code parsing and integrates directly into flake8's workflow. It is actively maintained and supports Python 3.9 through 3.13. The description notes it can be opinionated and potentially noisy depending on your coding style, and suggests pairing it with flake8-bugbear for broader coverage.
Use it for:
- Catch common async bugs and antipatterns in Trio-based applications before they reach production.
- Enforce consistent async idioms across a team's asyncio or AnyIO codebases during code review.
- Identify dead or pointless async code that may indicate misunderstanding of concurrency patterns.
- Detect likely performance issues in async functions that could cause bottlenecks or blocking.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A flake8 plugin that detects async-related issues in code using Trio, AnyIO, or asyncio, flagging bugs, dead code, performance problems, and idiom violations.
Yes, if you write async code with Trio, AnyIO, or asyncio and want linting coverage beyond general flake8 checks. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a safe addition. Be aware it is opinionated and may flag code you consider acceptable; review its rule documentation to decide if its strictness matches your team's standards.
Install
flake8-async on PyPI
pip
pip install flake8-asyncuv
uv add flake8-asyncpoetry
poetry add flake8-asyncInstalling flake8-async
Before you install
Low friction installation with a single runtime dependency (libcst). The project is actively maintained with a recent release and no known vulnerabilities.
License in practice
MIT license is permissive; you can use this plugin freely in commercial and private projects with minimal restrictions.
Quickstart
pip install flake8-async
# Then run flake8 on your async code:
flake8 your_async_file.py
# The plugin integrates automatically with flake8 and reports ASYNC-prefixed errors.
Requires Python 3.9 or later and an existing flake8 installation.
Verify before relying
- Whether the plugin's checks overlap significantly with ruff's async checks or if they complement each other.
- How noisy the checks are in typical async codebases and whether filtering is commonly needed.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — libcst |
| Maintenance | actively maintained — 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 351,920/month — #7,317 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flake8_async-26.7.1-py3-none-any.whl
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
anyioAnyIO provides a unified asynchronous API that…
permissive · top 100 on PyPI
asyncerAsyncer provides utility functions for working…
permissive · top 5,000 on PyPI
async_generatorProvides async generators and async context…
permissive · top 5,000 on PyPI
anysqliteAnysqlite wraps SQLite with an async/await…
unclear · top 5,000 on PyPI
outcomeCaptures the outcome of Python function…
permissive · top 1,000 on PyPI
sniffioDetects which async library (asyncio, Trio,…
permissive · top 100 on PyPI
pytest-trioA pytest plugin that enables testing of async…
permissive · top 15,000 on PyPI
flake8Flake8 is a command-line tool that combines…
permissive · top 1,000 on PyPI
flake8-eradicateA flake8 plugin that detects commented-out code…
permissive · top 15,000 on PyPI
async-extensionsProvides utilities and abstractions built on…
permissive · top 15,000 on PyPI