--- id: mangum version: "0.21.0" license: unclear license_treatment: permissive maintenance: active --- # mangum — AWS Lambda support for ASGI applications License: permissive · Maintenance: active · Downloads: 6.7M/mo ## What it is and what it does Mangum is a bridge that lets you run ASGI-based web applications directly on AWS Lambda. It translates Lambda events from various AWS services—API Gateway, Application Load Balancer, Function URLs, and Lambda@Edge—into the ASGI protocol, then converts the ASGI response back into a Lambda-compatible format. This lets you write your application once using a standard ASGI framework and deploy it to Lambda without rewriting for Lambda's native event model. The package handles practical deployment concerns: binary media types, payload compression (GZip or Brotli), and ASGI lifespan events for startup and shutdown. It integrates with standard deployment tools like Serverless Framework and AWS SAM, making it straightforward to incorporate into existing Lambda workflows. With a single runtime dependency and low install friction, it's designed to be a thin, transparent adapter. Use it for: - Deploy an ASGI REST API to Lambda behind API Gateway without rewriting the application. - Migrate an existing ASGI web app from a traditional server to Lambda with minimal code changes. - Build serverless web services that handle binary responses via API Gateway. - Use Lambda@Edge to serve dynamic content from CloudFront with an ASGI application. - Combine Lambda Function URLs with an ASGI framework for simple HTTP endpoints. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Mangum adapts ASGI applications to run on AWS Lambda, handling events from Function URLs, API Gateway (HTTP and REST), Application Load Balancer, and Lambda@Edge. Yes. Mangum is actively maintained, permissively licensed, and carries no known vulnerabilities. Install it if you need to run an ASGI application on AWS Lambda or are considering Lambda for an existing ASGI codebase. The single dependency and low friction make adoption straightforward. ## Install pip install mangum uv add mangum poetry add mangum ## Installing mangum Before you install: Low friction: pure Python wheel with a single runtime dependency (typing-extensions). Actively maintained with recent commits and a large user base (6749932 monthly downloads). License in practice: MIT license (permissive) imposes no restrictions on commercial or private use; you may modify and redistribute with attribution. Quickstart: pip install mangum from mangum import Mangum async def app(scope, receive, send): await send({ "type": "http.response.start", "status": 200, "headers": [[b"content-type", b"text/plain"]], }) await send({"type": "http.response.body", "body": b"Hello, world!"}) handler = Mangum(app, lifespan="off") Requires Python 3.9 or later; the ASGI application itself must be installed separately. Verify before relying: - Performance characteristics under high concurrency or large payloads on Lambda. - Compatibility matrix with specific versions of major ASGI frameworks. - Cold-start overhead compared to native Lambda handlers. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 6.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags asgi lambda adapter, serverless asgi framework, aws lambda http handler, api gateway asgi, lambda function url support, asgi aws deployment, lambda event adapter, aws-lambda, asgi-adapter, serverless [View on SkillFed](https://skillfed.io/packages/mangum) · [View on PyPI](https://pypi.org/project/mangum/)