powertools-request-binding
Middleware for AWS Lambda Powertools Event Handler that validates and injects route arguments using Modmex models instead of Pydantic.
Why
Powertools request validation currently requires Pydantic. This package provides a lightweight alternative for request binding in REST API and HTTP API handlers when your project uses Modmex.
Installation
poetry add powertools-request-binding modmex
Usage
from typing import Annotated
from modmex import BaseModel
from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from powertools_request_binding import Body, Query, RequestBindingMiddleware
class CreateTodoRequest(BaseModel):
title: str
completed: bool
app = APIGatewayRestResolver()
app.use(middlewares=[RequestBindingMiddleware()])
@app.post("/todos/<todo_id>")
def create_todo(
todo_id: int,
payload: Annotated[CreateTodoRequest, Body()],
source: Annotated[str | None, Query()] = None,
):
return {
"todo_id": todo_id,
"title": payload.title,
"completed": payload.completed,
"source": source,
}
Supported Input Sources
- Path parameters
- Query parameters
- Headers
- JSON body
Notes
- This package focuses on request argument binding only.
- Powertools
Depends(...)support remains native and should be used directly from Powertools when needed.
Metadata
Release files for powertools-request-binding 0.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 |
|---|---|---|---|---|
| powertools_request_binding-0.1.0.tar.gz | 6.2 kB | Without provenance | Details for powertools_request_binding-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| powertools_request_binding-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for powertools_request_binding-0.1.0-py3-none-any.whl |
Total release size: 14.6 kB
Release files / powertools_request_binding-0.1.0.tar.gz
| Download URL | powertools_request_binding-0.1.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e0a8e36daf49b34eef3f693bb16118f4848f494ac190a4770d3c6aa5f53b527
|
|
BLAKE2b-256 checksum How to use checksums |
b227a53e6135ff02555b15dcc4cf5a91b7dd76bd188e22e50b7079b604ab65e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Darwin/25.5.0
|
Release files / powertools_request_binding-0.1.0-py3-none-any.whl
| Download URL | powertools_request_binding-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8eff3ffd839476a6144647d1dbd474a8b7e1f2ffde049789a14fe743fded620f
|
|
BLAKE2b-256 checksum How to use checksums |
8cfb57cac9be620dc6f60c7cec7fb8e59a31d561b18e22e2568a0df24a9d6248
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Darwin/25.5.0
|
Security for powertools-request-binding 0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.