Reusable client middlewares for aiohttp
Project description
Reusable client middlewares for aiohttp.
aiohttp-client-middlewares is a small, pure-Python collection of ready-to-use client middlewares for aiohttp. It currently provides DigestAuthMiddleware, vendored from aiohttp core; this package is the canonical home for it going forward.
Middlewares plug into aiohttp.ClientSession through the client middleware API introduced in aiohttp 3.12, so they can wrap every outgoing request without subclassing the session.
Installation
$ pip install aiohttp-client-middlewares
This requires aiohttp >= 3.12 (the first release with the client-middleware API and DigestAuthMiddleware) and yarl >= 1.17.0. Both are pulled in automatically.
Supported Python versions: 3.10, 3.11, 3.12, 3.13 and 3.14.
Quickstart
Pass one or more middlewares to aiohttp.ClientSession via the middlewares argument. DigestAuthMiddleware transparently performs the HTTP Digest authentication handshake for every request made with the session:
import asyncio
import aiohttp
from aiohttp_client_middlewares import DigestAuthMiddleware
async def main() -> None:
digest = DigestAuthMiddleware("user", "pass")
async with aiohttp.ClientSession(middlewares=(digest,)) as session:
async with session.get("https://httpbin.org/digest-auth/auth/user/pass") as resp:
print("Status:", resp.status)
print("Body:", await resp.json())
asyncio.run(main())
Documentation
Links
Documentation: https://aiohttp-client-middlewares.readthedocs.io/
Changelog: https://github.com/aio-libs/aiohttp-client-middlewares/blob/master/CHANGES.rst
Issue tracker: https://github.com/aio-libs/aiohttp-client-middlewares/issues
Source code: https://github.com/aio-libs/aiohttp-client-middlewares
Communication channels
aio-libs Discussions: https://github.com/aio-libs/aiohttp-client-middlewares/discussions
Matrix: #aio-libs:matrix.org
License
aiohttp-client-middlewares is offered under the Apache-2.0 license. See the LICENSE file for the full text.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiohttp_client_middlewares-0.1.0.tar.gz.
File metadata
- Download URL: aiohttp_client_middlewares-0.1.0.tar.gz
- Upload date:
- Size: 34.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15563b0a81ecca4eec8e0744841635437c542f8729598ab51a68ddc03c904e7b
|
|
| MD5 |
00938ac466be27b2cb81686829d29f6b
|
|
| BLAKE2b-256 |
40554836c52f03c6e3b6d8445b0a18ea94114a4c11c3b485d1c9303865e5ba99
|
Provenance
The following attestation bundles were made for aiohttp_client_middlewares-0.1.0.tar.gz:
Publisher:
ci-cd.yml on aio-libs/aiohttp-client-middlewares
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiohttp_client_middlewares-0.1.0.tar.gz -
Subject digest:
15563b0a81ecca4eec8e0744841635437c542f8729598ab51a68ddc03c904e7b - Sigstore transparency entry: 1843587374
- Sigstore integration time:
-
Permalink:
aio-libs/aiohttp-client-middlewares@4976e57bbc785308ee407c1d5d6e1bf6e8518c84 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/aio-libs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@4976e57bbc785308ee407c1d5d6e1bf6e8518c84 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aiohttp_client_middlewares-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aiohttp_client_middlewares-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51657db1eac7a23feb0d4fc609b95b66471488328bba2e9e1700fa0674240b6c
|
|
| MD5 |
27add06826df80dd6d153d204f8e9339
|
|
| BLAKE2b-256 |
c8ae5560d224900c6cb10258e0f2e08ab4e2434026f042a7916f082cbc89ee60
|
Provenance
The following attestation bundles were made for aiohttp_client_middlewares-0.1.0-py3-none-any.whl:
Publisher:
ci-cd.yml on aio-libs/aiohttp-client-middlewares
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiohttp_client_middlewares-0.1.0-py3-none-any.whl -
Subject digest:
51657db1eac7a23feb0d4fc609b95b66471488328bba2e9e1700fa0674240b6c - Sigstore transparency entry: 1843587439
- Sigstore integration time:
-
Permalink:
aio-libs/aiohttp-client-middlewares@4976e57bbc785308ee407c1d5d6e1bf6e8518c84 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/aio-libs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@4976e57bbc785308ee407c1d5d6e1bf6e8518c84 -
Trigger Event:
push
-
Statement type: