--- id: apig-wsgi version: "2.20.0" license: MIT license_treatment: permissive maintenance: active --- # apig-wsgi — Wrap a WSGI application in an AWS Lambda handler function for running on API Gateway or an ALB. License: permissive · Maintenance: active · Downloads: 141.9K/mo ## What it is and what it does apig-wsgi is a thin adapter that lets you run existing WSGI applications on AWS Lambda by converting API Gateway and ALB events into WSGI environ dicts and wrapping responses back into the appropriate format. It handles both event format versions automatically, manages binary content encoding, and exposes Lambda context and request metadata through WSGI environ keys so your application can access AWS-specific details if needed. The package has no runtime dependencies and installs cleanly. It's designed for teams deploying WSGI applications to serverless without rewriting the application layer. Configuration is minimal: you create a lambda_handler by passing your WSGI app to make_lambda_handler(), then deploy that function to Lambda. The package handles format detection, multi-value headers on format version 1, and conditional base64 encoding of binary responses. Use it for: - Deploy a WSGI application behind an ALB in Lambda for cost-effective serverless HTTP handling. - Run a WSGI app on a Lambda Function URL with automatic binary response support. - Support both API Gateway REST and HTTP APIs with a single handler that auto-detects the event format. - Access Lambda context and API Gateway request metadata from within your WSGI application. - Wrap an existing WSGI application for Lambda without modifying application code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Wraps a WSGI application to run as an AWS Lambda handler on API Gateway, Lambda Function URLs, or ALBs, automatically detecting event format versions and handling binary responses. Yes. This is a mature, actively maintained bridge for running WSGI applications on AWS Lambda. It has no dependencies, low install friction, clean MIT licensing, and zero known vulnerabilities. Install it if you're deploying a WSGI application to Lambda. ## Install pip install apig-wsgi uv add apig-wsgi poetry add apig-wsgi ## Installing apig-wsgi Before you install: Low friction install with no runtime dependencies. Active maintenance with recent releases; last commit 2026-08-13. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install apig-wsgi from apig_wsgi import make_lambda_handler lambda_handler = make_lambda_handler(app) Requires Python 3.9 or later. Your WSGI application must be deployable to AWS Lambda with appropriate IAM permissions. Verify before relying: - Whether binary response support requires additional AWS configuration beyond what the package handles automatically. - Performance characteristics and cold-start overhead compared to native Lambda frameworks. - Specific Django and Flask compatibility versions beyond general WSGI support. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 141.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags aws lambda wsgi adapter, api gateway lambda handler, serverless wsgi wrapper, alb lambda wsgi, lambda function url handler, wsgi to lambda converter, lambda http handler, aws-lambda, wsgi-adapter, serverless [View on SkillFed](https://skillfed.io/packages/apig-wsgi) · [View on PyPI](https://pypi.org/project/apig-wsgi/)