{"id":16061085,"url":"https://github.com/amancevice/python-lambda-gateway","last_synced_at":"2026-03-05T17:42:04.146Z","repository":{"id":44866625,"uuid":"259389827","full_name":"amancevice/python-lambda-gateway","owner":"amancevice","description":"Simple HTTP server to invoke a Lambda function locally","archived":false,"fork":false,"pushed_at":"2024-03-10T15:19:32.000Z","size":125,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-23T09:12:25.727Z","etag":null,"topics":["api-gateway","asyncio","cli","lambda","python","zero-dependency"],"latest_commit_sha":null,"homepage":null,"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/amancevice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2020-04-27T16:31:15.000Z","updated_at":"2025-10-06T09:06:49.000Z","dependencies_parsed_at":"2024-10-27T15:32:18.756Z","dependency_job_id":"7cee7784-be65-4916-abd0-0dc061610409","html_url":"https://github.com/amancevice/python-lambda-gateway","commit_stats":{"total_commits":100,"total_committers":3,"mean_commits":"33.333333333333336","dds":0.4,"last_synced_commit":"a56a2070f777ed02b8ad420c4f868fc208ec2276"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/amancevice/python-lambda-gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amancevice%2Fpython-lambda-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amancevice%2Fpython-lambda-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amancevice%2Fpython-lambda-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amancevice%2Fpython-lambda-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amancevice","download_url":"https://codeload.github.com/amancevice/python-lambda-gateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amancevice%2Fpython-lambda-gateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30139372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","asyncio","cli","lambda","python","zero-dependency"],"created_at":"2024-10-09T04:07:48.584Z","updated_at":"2026-03-05T17:42:04.103Z","avatar_url":"https://github.com/amancevice.png","language":"Python","readme":"# Lambda Gateway\n\n[![pypi](https://img.shields.io/pypi/v/lambda-gateway?color=yellow\u0026logo=python\u0026logoColor=eee\u0026style=flat-square)](https://pypi.org/project/lambda-gateway/)\n[![python](https://img.shields.io/pypi/pyversions/lambda-gateway?logo=python\u0026logoColor=eee\u0026style=flat-square)](https://pypi.org/project/lambda-gateway/)\n[![pytest](https://img.shields.io/github/actions/workflow/status/amancevice/python-lambda-gateway/pytest.yml?logo=github\u0026style=flat-square)](https://github.com/amancevice/python-lambda-gateway/actions/workflows/pytest.yml)\n[![coverage](https://img.shields.io/codeclimate/coverage/amancevice/python-lambda-gateway?logo=code-climate\u0026style=flat-square)](https://codeclimate.com/github/amancevice/python-lambda-gateway/test_coverage)\n[![maintainability](https://img.shields.io/codeclimate/maintainability/amancevice/python-lambda-gateway?logo=code-climate\u0026style=flat-square)](https://codeclimate.com/github/amancevice/python-lambda-gateway/maintainability)\n\nTest AWS Lambda functions invoked as API Gateway proxy integrations locally.\n\nThis tool extends the native Python SimpleHTTPRequestHandler to proxy requests to a local Lambda function using the ThreadingHTTPServer.\n\nThis tool is was specifically implemented to use the standard Python library only. No additional pip installation is required.\n\nAfter installing, navigate to the directory where your Lambda function is defined and invoke it with the CLI tool using the configured handler, eg:\n\n```bash\nlambda-gateway [-p PORT] [-t SECONDS] lambda_function.lambda_handler\n# =\u003e Serving HTTP on :: port 8000 (http://[::]:8000/) ...\n```\n\n## Installation\n\nInstall with pip.\n\n```bash\npip install lambda-gateway\n```\n\n## Usage\n\nCreate a Lambda function handler in Python 3\n\n```python\n# ./lambda_function.py\nimport json\n\n\ndef lambda_handler(event, context=None):\n    # Get name from qs\n    params = event.get('queryStringParameters') or {}\n    name = params.get('name') or 'Pythonista'\n    # Return response\n    return {\n        'body': json.dumps({'text': f'Hello, {name}! ~ Lambda Gateway'}),\n        'statusCode': 200,\n        'headers': {\n            'Content-Type': 'application/json',\n        },\n    }\n```\n\nStart a local server with the signature of your Lambda handler as the argument.\n\n_Note — the handler must be importable from the current working directory_\n\n```bash\nlambda-gateway [-B PATH] [-b ADDR] [-p PORT] [-t SECONDS] lambda_function.lambda_handler\n# =\u003e Starting LambdaRequestHandler at http://localhost:8000/\n```\n\nTest the function with cURL.\n\n```bash\ncurl http://localhost:8000/?name=Pythonista\n# =\u003e {\"text\": \"Hello, Pythonista! ~ Lambda Gateway\"}\n```\n\n## Timeouts\n\nAPI Gateway imposes a 30 second timeout on Lambda responses. This constraint is implemented in this project using Python's async/await syntax.\n\nThe timeout length can be adjusted using the `-t / --timeout` CLI option.\n\n```bash\nlambda-gateway -t 3 lambda_function.lambda_handler\n```\n\n## API Gateway Payloads\n\nAPI Gateway supports [two versions](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html) of proxied JSON payloads to Lambda integrations, `1.0` and `2.0`.\n\nVersions `0.8+` of Lambda Gateway use `2.0` by default, but this can be changed at startup time using the `-V / --payload-version` option:\n\n```bash\nlambda-gateway -V1.0 lambda_function.lambda_handler\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famancevice%2Fpython-lambda-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famancevice%2Fpython-lambda-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famancevice%2Fpython-lambda-gateway/lists"}