aiohttp-middlewares
Collection of useful middlewares for aiohttp applications.
Decision gist · record as of 2026-08-14
Yes. Active maintenance, no vulnerabilities, low install friction, and a permissive license make this a safe choice. Install it if you are building an aiohttp.web application and want to avoid writing standard middleware boilerplate for CORS, error handling, or similar cross-cutting concerns.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires aiohttp 3.8.1 or later and Python 3.8+.
- Low install friction with a pure-Python wheel.
- Active maintenance with a recent commit on 2026-03-30 and stable production status.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive; you can use this in commercial and proprietary projects with minimal restrictions, provided you include the license text.
last release 2024-08-14 (730 days) · last repo commit 2026-03-30 · 54 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 198,526 downloads/mo, #9,727 on PyPI
Alternatives
Verify before relying
pip install aiohttp-middlewares
from aiohttp import web
from aiohttp_middlewares import cors_middleware, error_middleware
app = web.Application(
middlewares=(
cors_middleware(origins=("http://localhost:8081",)),
error_middleware(),
)
)- Whether all advertised middlewares are documented and which ones are most commonly used in production.
- Performance characteristics when stacking multiple middlewares on high-traffic applications.
What it is and what it does
aiohttp-middlewares is a curated collection of middleware functions designed to fill gaps in aiohttp.web's built-in middleware offerings. It addresses common web-development patterns—CORS header injection, centralized error handling, request shielding—that developers would otherwise implement themselves. The package works as a drop-in set of middleware factories that you pass to aiohttp's Application constructor.
The package depends on aiohttp, async-timeout, and yarl, all standard async-web components. It is actively maintained, supports Python 3.8 through 3.12, and carries no known security vulnerabilities. The BSD-3-Clause license permits use in any project type.
Use it for
- Enable CORS headers for cross-origin requests in a single middleware registration.
- Centralize error handling and HTTP exception responses across all routes.
- Shield view handlers from cancellation during request processing.
- Add request/response logging or timing middleware to an aiohttp application.
- Implement common security headers or request validation patterns without custom code.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Active maintenance, no vulnerabilities, low install friction, and a permissive license make this a safe choice. Install it if you are building an aiohttp.web application and want to avoid writing standard middleware boilerplate for CORS, error handling, or similar cross-cutting concerns.
Install
aiohttp-middlewares on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent commit on 2026-03-30 and stable production status.
Requires aiohttp 3.8.1 or later and Python 3.8+.
License in practice
BSD-3-Clause is permissive; you can use this in commercial and proprietary projects with minimal restrictions, provided you include the license text.
Quickstart
pip install aiohttp-middlewares
from aiohttp import web
from aiohttp_middlewares import cors_middleware, error_middleware
app = web.Application(
middlewares=(
cors_middleware(origins=("http://localhost:8081",)),
error_middleware(),
)
)
Verify before relying
- Whether all advertised middlewares are documented and which ones are most commonly used in production.
- Performance characteristics when stacking multiple middlewares on high-traffic applications.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release <4.0,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesaiohttpasync-timeoutyarl |
| Maintenance | Actively maintained 730 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 198,526 / month, #9,727 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: AsyncIOFramework :: aiohttpIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: WSGI :: MiddlewareTopic :: UtilitiesTyping :: Typed |
Evidence: aiohttp_middlewares-2.4.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 › “aiohttp middleware collection”
- aiohttp-middlewaresProvides a collection of ready-to-use middlewares for aiohttp.web…
- aiohttp-basicauthProvides HTTP basic authentication middleware for aiohttp…
- aiohttp-debugtoolbarAdds an interactive debug toolbar to aiohttp web applications,…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also aiohttp-basicauth · aiohttp-cors · aiohttp-session · aiohttp-wsgi · django-cors-headers · flask-cors · aiohttp-jinja2 · quart-cors · aiointercept · aiohttp-swagger