awsgi2
A WSGI gateway for the AWS API Gateway/Lambda proxy integration
What it is and what it does
awsgi2 is a WSGI adapter that lets you run WSGI-compatible middleware and frameworks on AWS Lambda. It translates API Gateway proxy integration events into WSGI-compatible request/response pairs, allowing frameworks to work without modification in a serverless environment. The package is an improved fork of the original aws-wsgi project.
You install it, wrap your WSGI application in awsgi2.response() inside a Lambda handler, and deploy. It handles the event-to-WSGI conversion and response formatting, including support for base64-encoded content types. The package supports Python 3.8 through 3.12 and has a single runtime dependency on libadvian.
Use it for:
- Deploy a WSGI application to AWS Lambda without rewriting it for serverless.
- Convert API Gateway proxy events into standard WSGI requests for existing frameworks.
- Serve binary content from Lambda by configuring base64_content_types.
- Migrate a traditional WSGI application to AWS Lambda with minimal code changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Bridges WSGI-compatible web frameworks to AWS Lambda by converting API Gateway proxy integration events into WSGI requests and responses.
Yes, if you need to run a WSGI framework on AWS Lambda and accept dormant maintenance. The package is stable and does one thing well, but expect no active development or bug fixes. Suitable for production use in stable, low-change applications; risky for projects requiring ongoing support or frequent updates.
Install
awsgi2 on PyPI
pip
pip install awsgi2uv
uv add awsgi2poetry
poetry add awsgi2Installing awsgi2
Before you install
Low install friction with a single runtime dependency. Maintenance is dormant—last release was 605 days ago—so expect no active updates or bug fixes, though the package remains functional for its narrow use case.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it safe to adopt in most projects without licensing concerns.
Quickstart
pip install awsgi2
import awsgi2
def lambda_handler(event, context):
return awsgi2.response(app, event, context, base64_content_types={"image/png"})
Requires Python 3.8 or later; designed specifically for AWS Lambda with API Gateway proxy integration.
Verify before relying
- Whether libadvian is a required runtime dependency or an optional build/development tool.
- Current state of the upstream original aws-wsgi project and whether awsgi2 remains the recommended fork.
- Specific WSGI frameworks confirmed compatible beyond those mentioned in the description excerpt.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — libadvian |
| Maintenance | dormant — 605 days since the last release |
| First released | |
| Downloads | 80,993/month — #14,258 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: awsgi2-1.0.2-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
serverless-wsgiBridges Python WSGI applications (Flask,…
permissive · top 15,000 on PyPI
WSGIProxy2WSGIProxy2 wraps a remote HTTP application as a…
permissive · top 15,000 on PyPI
apig-wsgiWraps a WSGI application to run as an AWS…
permissive · top 15,000 on PyPI
zappaZappa packages and deploys Python WSGI and ASGI…
permissive · top 15,000 on PyPI
mangumMangum adapts ASGI applications to run on AWS…
permissive · top 5,000 on PyPI
aiohttp-wsgiRuns WSGI applications like Django and Flask on…
permissive · top 15,000 on PyPI
awslambdaricImplements the AWS Lambda Runtime API to make…
permissive · top 5,000 on PyPI
Flask-AWSCognitoIntegrates AWS Cognito user authentication into…
permissive · top 15,000 on PyPI