urllib3 SigV4
Extension to urllib3 adding support for signing the requests with AWS Signature Version 4. It uses the Boto3 library for handling the AWS credentials and the actual signing process.
Installation
To install the package, use either pip:
pip install urllib3_sigv4
or uv:
uv add urllib3_sigv4
Usage
This library provides a drop-in replacement for two main components of urllib3,
the PoolManager
class and the top-level request
method. It adds a new optional parameter which determines if and how the
requests should be signed.
Creating a Signer
First, create an instance of the SigV4RequestSigner class which defines the
parameters for request signing:
from urllib3_sigv4 import SigV4RequestSigner
signer = SigV4RequestSigner(
"lambda",
region="eu-central-1",
access_key="AKIAIOSFODNN7EXAMPLE",
secret_key="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
)
The first parameter is mandatory and identifies the AWS service we want to make
requests to (AWS Lambda in this case). The region, access_key and
secret_key parameters are optional and will be inferred from the environment
if not passed (via the default Boto3 session, see
here
and here
for more details).
Making Requests
To make signed requests to an AWS service, pass the signer instance via the
signer parameter when creating the PoolManager:
from urllib3_sigv4 import PoolManager, SigV4RequestSigner
signer = SigV4RequestSigner("lambda")
http = PoolManager(signer=signer)
response = http.request(
"POST",
"https://my-lambda-url-id.lambda-url.eu-central-1.on.aws",
json={"name": "John Doe", "age": 30}
)
print(response.json())
You can also provide the signer in individual request method calls to
override the default behavior:
from urllib3_sigv4 import PoolManager, SigV4RequestSigner
signer = SigV4RequestSigner("lambda")
http = PoolManager()
# The same as when using urllib3's PoolManager.
response = http.request("GET", "https://httpbin.org/get")
print(response.json())
# This request will be signed.
response = http.request(
"POST",
"https://my-lambda-url-id.lambda-url.eu-central-1.on.aws",
json={"name": "John Doe", "age": 30},
signer=signer
)
print(response.json())
You can also use a convenience top-level request method which uses a
module-global PoolManager instance:
from urllib3_sigv4 import SigV4RequestSigner, request
signer = SigV4RequestSigner("lambda")
response = request(
"POST",
"https://my-lambda-url-id.lambda-url.eu-central-1.on.aws",
json={"name": "John Doe", "age": 30},
signer=signer
)
print(response.json())
Reference
Metadata
Release files for urllib3-sigv4 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| urllib3_sigv4-1.1.0.tar.gz | 6.5 kB | With provenance | Details for urllib3_sigv4-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| urllib3_sigv4-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for urllib3_sigv4-1.1.0-py3-none-any.whl |
Total release size: 11.4 kB
Release files / urllib3_sigv4-1.1.0.tar.gz
| Download URL | urllib3_sigv4-1.1.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2b3fbc9cbf3257004ae3b8396bd88b6cf488c42990ffe71050825af063b6191
|
|
BLAKE2b-256 checksum How to use checksums |
04098b17948c7fa8c2ae18ec6fc168c7dced5dc95ebb8ef6af03b301c057a48d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 15, 2025.
Transparency logRelease files / urllib3_sigv4-1.1.0-py3-none-any.whl
| Download URL | urllib3_sigv4-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15fbfe56139281f89e6eee1a2908a67271ce1de5afb7eb26d6ad543c9aaa9029
|
|
BLAKE2b-256 checksum How to use checksums |
fa772607259ef85d46a1fdda8cbd6318d7452fe693db2b7999506873ad5d1666
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 15, 2025.
Transparency logSecurity for urllib3-sigv4 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for urllib3_sigv4-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 15, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.