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.

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.39.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.39.0
File Size Uploaded Provenance Actions
aws_lambda_powertools-3.39.0.tar.gz 837.3 kB With provenance Details for aws_lambda_powertools-3.39.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.8 MB

Release files / aws_lambda_powertools-3.39.0.tar.gz

Download URL aws_lambda_powertools-3.39.0.tar.gz
Size 837.3 kB
Tags Source
SHA-256 checksum
How to use checksums
94d640db4d9b772a3627c5916de36c303250d32ec10b7bf36c71b276dd824939
BLAKE2b-256 checksum
How to use checksums
cbf47be0e86c088c500f439176d09f251d737694b51a7b351495a5ce9f723ede
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 3, 2026.

Transparency log

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

Download URL aws_lambda_powertools-3.39.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
dc47690e0a3ced07bfe463a8bb6d1d3945b98bdc21e825196d37e9a3c9707f9f
BLAKE2b-256 checksum
How to use checksums
014308a1ab8943755e90e3142def8ae74d933d170df65c0993ae9d2ac2f2469d
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 3, 2026.

Transparency log

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aws_lambda_powertools-3.39.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 3, 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.39.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