{"id":16542550,"url":"https://github.com/jordaneremieff/asgitools","last_synced_at":"2025-09-22T08:59:24.484Z","repository":{"id":89251370,"uuid":"130543028","full_name":"jordaneremieff/asgitools","owner":"jordaneremieff","description":"A collection of tools for developing ASGI applications. Supports both ASGI  servers, uvicorn and daphne.","archived":false,"fork":false,"pushed_at":"2020-06-13T05:21:24.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T08:48:03.986Z","etag":null,"topics":["asgi","asyncio","channels","daphne","python","python3","uvicorn","uvloop"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jordaneremieff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-04-22T06:56:11.000Z","updated_at":"2018-04-27T09:12:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a083b55-5d95-4a5d-97b6-8b308dd1c3b0","html_url":"https://github.com/jordaneremieff/asgitools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jordaneremieff/asgitools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fasgitools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fasgitools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fasgitools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fasgitools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordaneremieff","download_url":"https://codeload.github.com/jordaneremieff/asgitools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fasgitools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276375736,"owners_count":25631316,"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","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["asgi","asyncio","channels","daphne","python","python3","uvicorn","uvloop"],"created_at":"2024-10-11T18:57:54.047Z","updated_at":"2025-09-22T08:59:24.447Z","avatar_url":"https://github.com/jordaneremieff.png","language":"Python","readme":"# asgitools\n\nA collection of tools for developing [ASGI] applications. Supports both ASGI servers, [uvicorn] and [daphne].\n\n**Requirements**: Python 3.5.3+ and an ASGI server\n\nCurrently includes:\n\n- Protocol and URL routing\n- WSGI debug middleware\n- Redis broadcast middleware\n\n## Quickstart\n\nYou can find an example app in `examples/` that demonstrates protocol, url routing, middleware usage, and wsgi debugger.\n\nOtherwise you can try the example below to run a simple HTTP app:\n\nInstall using `pip`:\n\n- TODO\n\nCreate an application, in `app.py`:\n\n```python\nfrom asgitools.routing import (\n    AsgiProtocolRouter,\n    AsgiProtocol,\n    AsgiUrlRouter,\n    AsgiUrlRoute\n)\n\n\nclass HttpConsumer:\n\n    def __init__(self, scope):\n        self.scope = scope\n\n    async def __call__(self, receive, send):\n        message = await receive()\n        if message['type'] == 'http.request':\n            await send({\n                'type': 'http.response.start',\n                'status': 200,\n                'headers': [\n                    [b'content-type', b'text/html'],\n                ],\n            })\n            await send({\n                'type': 'http.response.body',\n                'body': b'Hello world!',\n                'more_body': False,\n            })\n\n\napp = AsgiProtocolRouter([\n    AsgiProtocol(\n        'http',\n        AsgiUrlRouter([\n            AsgiUrlRoute(\n                '/', HttpConsumer, methods=['GET']\n            ),\n        ])\n    ),\n])\n\n```\n\nRun the server:\n\n```shell\n$ uvicorn app:app\n```\n\nOR\n\n```shell\n$ daphne app:app\n```\n---\n\n# Todo\n\n- Tests\n- Middleware\n- Better examples\n\n[ASGI]: https://github.com/django/asgiref/blob/master/specs/asgi.rst\n[uvicorn]: https://github.com/encode/uvicorn\n[daphne]: https://github.com/django/daphne\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordaneremieff%2Fasgitools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordaneremieff%2Fasgitools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordaneremieff%2Fasgitools/lists"}