Open-source project
aws-powertools/powertools-lambda-python avatar
aws-powertools/powertools-lambda-python

aws-lambda-powertools keeps its base install at two dependencies and gates its build on six checks

A developer toolkit to implement Serverless best practices and increase developer velocity.

3,292 stars507 forksPythonMIT-0

At a glance

What is it?
Powertools for AWS Lambda (Python) splits four core utilities from a long tail of language specific ones, and pushes almost every dependency behind an extra. The default branch is develop, the newest tag is v3.35.0, and the packaging metadata names two different licenses at once.
Who is it for?
Powertools for AWS Lambda (Python) is worth adopting when you already run Python on Lambda and want tracing, structured logging, EMF metrics and an event handler without writing the context plumbing per function, because those four utilities are the ones the project keeps aligned across its Java, TypeScript and .NET siblings. Two things to settle first.
Can I use it commercially?
Yes. MIT-0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 5, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Two runtime dependencies, one extra per utility

The base install is jmespath and typing-extensions, both with an upper bound below the next major. Everything else is an optional extra, and each extra maps to one documented utility: parser pulls pydantic above 2.4, validation pulls fastjsonschema above 2.14.5, tracer pulls aws-xray-sdk above 2.8, then redis, valkey-glide and a jwt group of pyjwt, cryptography and urllib3. That is the whole dependency surface for a package whose feature list runs to a dozen utilities, and it is the first thing to check when you hit an ImportError after adding the tracer. The developer target syncs a much wider set than the packaging metadata shows, with uv sync --locked --extra all --extra redis --extra datamasking --extra valkey, so the extras named there go beyond the ones visible in the project table.

The packaging metadata names two licenses at once

Three declarations of the same thing do not agree. The repository is recorded under MIT-0. The project table carries a license entry with the text MIT. And the classifier list contains both the MIT License classifier and the MIT No Attribution License classifier, in the same array, which is a single package claiming to be two licenses at once. The MIT-0 reading is the one to plan for, since that is what the repository field says and the other classifiers look inherited from an earlier metadata format rather than deliberately added. If your compliance check reads a classifier or a license field instead of the LICENSE file at the root, this is the case that will send someone to a lawyer for no reason.

make pr chains six gates, and build refuses to skip them

The Makefile is organised so that nothing ships without the checks. The target called target does nothing but call pr, and pr runs format-check through lint, lint-docs, mypy, pre-commit, test, security-baseline and complexity-baseline. build depends on pr and then calls uv build --no-sources, so a wheel cannot be produced in a tree that fails any of those. test itself is two commands: a pytest run excluding tests/e2e and marked not perf with coverage written to XML, then a separate run over tests/performance with the cache cleared first. security-baseline calls bandit against the package with bandit.baseline as its baseline file, which means the accepted findings are committed rather than reviewed on every run. The default branch is develop, pushed on 2026-10-02, after the v3.35.0 tag of 2026-09-15, so the branch you clone is ahead of the newest release. The test target is two commands rather than one:

code
test:
	uv run --locked pytest -m "not perf" --ignore tests/e2e --cov=aws_lambda_powertools --cov-report=xml
	uv run --locked pytest --cache-clear tests/performance

The e2e tests are excluded there and run by a target of their own.

Four linters are configured and one of them is called

The repository root carries .flake8, .pylintrc, ruff.toml and .markdownlint.yaml, plus a .markdownlintignore and a .pre-commit-config.yaml. The Makefile only ever invokes two of them. Formatting and linting go through ruff format and ruff check over the package, the tests and the examples, and documentation is linted by running markdownlint-cli in a Docker container with the working tree mounted at /markdown. So the flake8 and pylint configuration files are present without a Makefile target that reads them, which usually means pre-commit or an editor integration reaches them instead. That is worth knowing before editing a rule in the wrong file and finding that make lint never mentions it. There is also a mypy.ini for the type gate that pr runs separately from ruff.

The end to end suite is a CDK app installed by npm

A Python repository carries package.json and package-lock.json at its root, and this one is no exception. The manifest is named aws-lambda-powertools-python-e2e, version 1.0.0, with a single devDependency on aws-cdk at ^2.1143.0. The end to end tests are therefore driven by infrastructure as code rather than by fixtures, and a .cfnlintrc.yaml at the root configures the CloudFormation linter for those templates. The tree also holds parallel_run_e2e.py for running them in parallel and .clusterfuzzlite/ for fuzzing. Practical consequence: a local checkout of this package needs Node and a CDK install to run tests/e2e, even though nothing in the Python package itself needs either, and the Makefile keeps e2e out of the default test target for that reason.

Metrics are documented as EMF while an example ships Datadog

The Metrics utility is described in one line as custom metrics created asynchronously through CloudWatch Embedded Metric Format. The examples directory contradicts the exclusivity of that framing, because it contains a metrics_datadog directory alongside metrics. So a Datadog path exists in the tree that the feature list does not mention, which means either the example targets a separate integration or the README under-describes what Metrics covers. The same pattern shows up elsewhere in the examples: circuit_breaker has no entry in the feature list at all, and neither does auth_alpha, which is named after an AWS feature phase rather than after anything in the documentation. The examples list runs to twenty-seven directories, and treating it as the feature list will mislead you in both directions.

The customer list is an issue form, and the docs link is garbled

The README keeps a list of companies using the library, Alma Media, Capital One, CyberArk, EF Education First, Guild and others, and it explains exactly how to get on it: raise a support_powertools issue through a template with the customer-reference label. The list is therefore self reported and opt in, maintained by opening a ticket, not audited. That is a normal way to run such a list and worth stating as what it is. The same block of links that points at the documentation site, PyPI, the roadmap and the blog has a garbled label on the first entry, which reads with a broken character followed by Doccumentation. It is the label, not the target: the link underneath it resolves to the documentation index. Four languages of this README are maintained as separate ports, Java, TypeScript and .NET alongside this one.

The core four are the parts other ports also implement

The project draws its own line between what is core and what is not, and that line is worth reading before you decide a utility is missing. Tracing, Logging, Metrics and Event Handler are the utilities available across all Powertools for AWS Lambda languages, and the rest are described as subject to each language ecosystem and customer demand. So a gap in the Python port for a utility that exists in the TypeScript port is by design rather than an oversight, and the four core ones are where behaviour across languages is meant to line up. Within those four, the surface is still wide: the event handlers cover AppSync resolvers, AppSync Events for WebSocket pub/sub, API Gateway, ALB, Lambda Function URLs, VPC Lattice and Bedrock agents with generated OpenAPI schemas.

Editorial conclusion

Powertools for AWS Lambda (Python) is worth adopting when you already run Python on Lambda and want tracing, structured logging, EMF metrics and an event handler without writing the context plumbing per function, because those four utilities are the ones the project keeps aligned across its Java, TypeScript and .NET siblings. Two things to settle first. The base install is deliberately thin, so a utility you actually use will add a dependency, and the extras list in the packaging metadata is longer than the feature list in the README suggests. And the license metadata disagrees with itself, naming both MIT and MIT-0, which matters if your compliance tooling reads the field rather than the file. Run `make pr` before trusting a local checkout: it chains lint, doc lint, type checking, pre-commit, tests, a bandit baseline and a complexity baseline.

Frequently asked questions

What is Powertools for AWS Lambda (Python)?

A developer toolkit for serverless applications on Lambda. Tracing, Logging, Metrics and Event Handler are the core utilities available across all Powertools for AWS Lambda languages, and the remaining utilities, among them Batch processing, Parser, Idempotency, Kafka and Streaming, are specific to each language ecosystem.

What does pip install aws-lambda-powertools pull in by default?

Only jmespath and typing-extensions. Each utility dependency is an optional extra, so pydantic arrives with the parser extra, fastjsonschema with validation, aws-xray-sdk with tracer, and then redis, valkey-glide and pyjwt come from their own extras.

Which Python versions does aws-lambda-powertools support?

The project requires Python 3.10 or newer and below 4.0.0, and its classifiers name 3.10 through 3.14.

How are the tests for Powertools for AWS Lambda Python run?

The test target runs pytest while excluding tests/e2e and anything marked not perf, with coverage written to XML, then runs tests/performance separately with the cache cleared. The pr target chains that with ruff, markdownlint, mypy, pre-commit, a bandit baseline and a complexity baseline.

Does the batch processing utility handle partial failures?

Yes, it is described as handling partial failures for SQS, Kinesis Data Streams and DynamoDB Streams batch processing. The Kafka utility sits alongside it and deserializes and validates Avro, Protocol Buffers and JSON Schema payloads.

Official sources

  1. aws-powertools/powertools-lambda-python on GitHub
  2. License: MIT-0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/aws-powertools-powertools-lambda-python.svg)](https://hysenlabs.com/projects/aws-powertools-powertools-lambda-python)