skillfed

awsgi2

A WSGI gateway for the AWS API Gateway/Lambda proxy integration

awsgi2 v1.0.2 81.0K downloads/30d#14,258 on PyPI
Permissive license MIT DORMANT released

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 awsgi2

uv

uv add awsgi2

poetry

poetry add awsgi2

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

wsgi aws lambdaapi gateway lambda proxyserverless wsgi adapteraws lambda web frameworklambda wsgi gateway
aws-lambdawsgi-adapterserverless

More Dynamic Content packages