Skip to main content

Powertools for AWS Lambda (Python)

Build codecov.io PythonSupport PyPI version PyPi monthly downloads OpenSSF Scorecard Discord

Powertools for AWS Lambda (Python) is a developer toolkit for AWS Lambda: structured logging, tracing, metrics, event handlers for API Gateway, AppSync and Bedrock Agents, idempotency, batch processing, parameters, validation, and more. Each utility is independent, follows the Lambda execution model, and is designed to add as little as possible to your cold start.

Also available in TypeScript, Java, and .NET.

📜 Documentation | 🐍 PyPI | 🎓 Workshop | 🗺️ Roadmap | 📝 Changelog

hero-image

Installation

pip install aws-lambda-powertools
# or
uv add aws-lambda-powertools

Or use the public Lambda layer, published for every supported Python version on x86_64 and arm64. Some utilities need an extra, for example aws-lambda-powertools[parser] for Pydantic; the installation guide lists them.

Building with a coding agent? Install the Powertools skill so Claude Code, Codex, Cursor or Gemini CLI work from the current documentation and examples: npx skills add aws-powertools/powertools-lambda-python.

Features

Core

Utilities

  • Parameters - Retrieve and cache parameter values from Parameter Store, Secrets Manager, AppConfig or DynamoDB
  • Idempotency - Make your Lambda functions idempotent and safe to retry, with DynamoDB, Redis or Valkey persistence
  • Batch processing - Handle partial failures for SQS, Kinesis Data Streams and DynamoDB Streams batches
  • Circuit Breaker - Stop calling a failing downstream and recover with a single probe across execution environments
  • Kafka - Deserialize and validate Kafka events with Avro, Protocol Buffers and JSON Schema
  • Event source data classes - Typed access to the payloads of common Lambda event sources
  • Parser - Data parsing and deep validation with Pydantic, with models and envelopes for common event sources
  • Validation - JSON Schema validation for inbound events and responses
  • Feature Flags - A rule engine to evaluate when one or more features should be enabled depending on the input
  • Data Masking - Erase or encrypt confidential fields in your data with AWS KMS
  • Auth (alpha) - JWT access-token verification and an OAuth2 client-credentials client for downstream APIs
  • Streaming - Stream S3 objects larger than the available memory, with gzip, CSV and other transforms
  • Metadata - Read the Lambda Metadata Endpoint, such as the Availability Zone ID of the execution environment
  • Middleware factory - Decorator factory to run your own logic before and after each invocation
  • Typing - Static typing for the Lambda context object
  • JMESPath Functions - Built-in JMESPath functions to deserialize common encoded JSON payloads

Lambda features

  • Lambda Managed Instances - Using Powertools when one execution environment handles concurrent invocations
  • Durable Functions - Using Powertools with Lambda Durable Functions
  • Build recipes - Packaging, cross-platform builds, cold start optimization and CI/CD integration

Tutorial and examples

How to support Powertools for AWS Lambda (Python)?

Becoming a reference customer

Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (Python), you can request to have your name and logo added to the README file by raising a Support Powertools for AWS Lambda (Python) (become a reference) issue.

The following companies, among others, use Powertools:

Sharing your work

Share what you did with Powertools for AWS Lambda (Python) 💞💞. Blog post, workshops, presentation, sample apps and others. Check out what the community has already shared about Powertools for AWS Lambda (Python) in this link.

Using the Lambda layer

Using the public layer helps us understand who uses Powertools for AWS Lambda (Python) in a non-intrusive way, and helps us gain future investments for other Powertools for AWS Lambda languages. You can still add Powertools for AWS Lambda (Python) as a dev dependency (or as part of your virtual env) to not impact the development process.

Contributing

Issues and pull requests are welcome, including the ones written with AI assistance. If you used an assistant, say so in the issue or PR and tell us how you verified the change: which tests you ran yourself, and which real AWS service or event you validated against when it applies. Read CONTRIBUTING.md for the process, AGENTS.md for the rules the CI enforces, and docs/adr for the premises behind them.

Credits

Connect

Security disclosures

If you think you've found a potential security issue, please do not post it in the Issues. Instead, follow SECURITY.md: report it through the AWS vulnerability reporting page or email AWS security directly.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

Metadata

Release files for aws-lambda-powertools 3.41.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-lambda-powertools 3.41.0
File Size Uploaded Provenance Actions
aws_lambda_powertools-3.41.0.tar.gz 845.9 kB With provenance Details for aws_lambda_powertools-3.41.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-lambda-powertools 3.41.0
File Interpreter ABI Platform Actions
aws_lambda_powertools-3.41.0-py3-none-any.whl Python 3 none any Details for aws_lambda_powertools-3.41.0-py3-none-any.whl

Total release size: 1.9 MB

Release files / aws_lambda_powertools-3.41.0.tar.gz

Download URL aws_lambda_powertools-3.41.0.tar.gz
Size 845.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d3b899f851eae0e31100d8586a4d232b845e0d9319311ae33e766c77c17952ff
BLAKE2b-256 checksum
How to use checksums
e0f5596817cd2beeeb42ed5fe3e5a21bcacff2f57eef1a7aafb05b73a0f43247
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Release files / aws_lambda_powertools-3.41.0-py3-none-any.whl

Download URL aws_lambda_powertools-3.41.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1a3a2cef8a7e6e4d460d48a2ed16ae9b0b12bd574697f23d03d14119951d8deb
BLAKE2b-256 checksum
How to use checksums
8745519d0eb86c3f2aa586c68cbefe6765b19bdd51573936f91df4d86ec0edf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 18, 2026.

Transparency log

Security for aws-lambda-powertools 3.41.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.

Select from 2 files

Attestation for aws_lambda_powertools-3.41.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 Nov 18, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

3.41.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page