{"id":25907432,"url":"https://github.com/erm/mangum","last_synced_at":"2025-03-03T07:01:25.367Z","repository":{"id":40515480,"uuid":"165652505","full_name":"Kludex/mangum","owner":"Kludex","description":"AWS Lambda support for ASGI applications","archived":false,"fork":false,"pushed_at":"2024-12-06T08:36:54.000Z","size":1917,"stargazers_count":1814,"open_issues_count":32,"forks_count":127,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-02-24T22:42:37.206Z","etag":null,"topics":["api-gateway","asgi","asyncio","aws","aws-lambda","django","fastapi","lambda","python","python3","quart","sanic","serverless","starlette"],"latest_commit_sha":null,"homepage":"http://mangum.fastapiexpert.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kludex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Kludex"}},"created_at":"2019-01-14T11:49:29.000Z","updated_at":"2025-02-24T08:02:36.000Z","dependencies_parsed_at":"2024-01-12T19:48:02.889Z","dependency_job_id":"7dbd3bc2-09ce-4e63-9a64-b0a0a14151a0","html_url":"https://github.com/Kludex/mangum","commit_stats":{"total_commits":413,"total_committers":35,"mean_commits":11.8,"dds":"0.23728813559322037","last_synced_commit":"34406b8de440b9ea1472d58844ce282971430ec2"},"previous_names":["erm/mangum","kludex/mangum"],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fmangum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fmangum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fmangum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kludex%2Fmangum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kludex","download_url":"https://codeload.github.com/Kludex/mangum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241622601,"owners_count":19992503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","asgi","asyncio","aws","aws-lambda","django","fastapi","lambda","python","python3","quart","sanic","serverless","starlette"],"created_at":"2025-03-03T07:00:43.388Z","updated_at":"2025-03-03T07:01:25.360Z","avatar_url":"https://github.com/Kludex.png","language":"Python","readme":"# Mangum\n\n\u003ca href=\"https://pypi.org/project/mangum/\"\u003e\n    \u003cimg src=\"https://badge.fury.io/py/mangum.svg\" alt=\"Package version\"\u003e\n\u003c/a\u003e\n\u003cimg alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/mangum.svg?style=flat-square\"\u003e\n\nMangum is an adapter for running [ASGI](https://asgi.readthedocs.io/en/latest/) applications in AWS Lambda to handle Function URL, API Gateway, ALB, and Lambda@Edge events.\n\n***Documentation***: https://mangum.fastapiexpert.com/\n\n## Features\n\n- Event handlers for API Gateway [HTTP](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) and [REST](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html) APIs, [Application Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html), [Function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html), and [CloudFront Lambda@Edge](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html).\n\n- Compatibility with ASGI application frameworks, such as [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [Quart](https://pgjones.gitlab.io/quart/) and [Django](https://www.djangoproject.com/).\n\n- Support for binary media types and payload compression in API Gateway using GZip or Brotli.\n\n- Works with existing deployment and configuration tools, including [Serverless Framework](https://www.serverless.com/) and [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html).\n\n- Startup and shutdown [lifespan](https://asgi.readthedocs.io/en/latest/specs/lifespan.html) events.\n\n## Installation\n\n```shell\npip install mangum\n```\n\n## Example\n\n```python\nfrom mangum import Mangum\n\nasync def app(scope, receive, send):\n    await send(\n        {\n            \"type\": \"http.response.start\",\n            \"status\": 200,\n            \"headers\": [[b\"content-type\", b\"text/plain; charset=utf-8\"]],\n        }\n    )\n    await send({\"type\": \"http.response.body\", \"body\": b\"Hello, world!\"})\n\n\nhandler = Mangum(app, lifespan=\"off\")\n```\n\nOr using a framework:\n\n```python\nfrom fastapi import FastAPI\nfrom mangum import Mangum\n\napp = FastAPI()\n\n\n@app.get(\"/\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n\n\n@app.get(\"/items/{item_id}\")\ndef read_item(item_id: int, q: str = None):\n    return {\"item_id\": item_id, \"q\": q}\n\nhandler = Mangum(app, lifespan=\"off\")\n```\n","funding_links":["https://github.com/sponsors/Kludex"],"categories":["Extensions","Serverless"],"sub_categories":["Deployment / Serverless","Other","Tutorials"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferm%2Fmangum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferm%2Fmangum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferm%2Fmangum/lists"}