{"id":13691141,"url":"https://github.com/cofin/litestar-granian","last_synced_at":"2025-03-22T02:31:44.424Z","repository":{"id":197688648,"uuid":"699131169","full_name":"cofin/litestar-granian","owner":"cofin","description":"Granian plugin for Litestar","archived":false,"fork":false,"pushed_at":"2025-03-07T02:50:43.000Z","size":1099,"stargazers_count":21,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T05:46:02.441Z","etag":null,"topics":["asgi","asgi-server","granian","litestar","litestar-api","litestar-framework"],"latest_commit_sha":null,"homepage":"","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/cofin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-02T01:34:15.000Z","updated_at":"2025-03-12T14:27:44.000Z","dependencies_parsed_at":"2024-01-04T04:29:42.548Z","dependency_job_id":"c5b1b4e7-498d-4977-9a7e-98c517d389ac","html_url":"https://github.com/cofin/litestar-granian","commit_stats":null,"previous_names":["cofin/litestar-granian"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofin%2Flitestar-granian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofin%2Flitestar-granian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofin%2Flitestar-granian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofin%2Flitestar-granian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cofin","download_url":"https://codeload.github.com/cofin/litestar-granian/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173554,"owners_count":20410300,"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":["asgi","asgi-server","granian","litestar","litestar-api","litestar-framework"],"created_at":"2024-08-02T17:00:40.848Z","updated_at":"2025-03-22T02:31:44.140Z","avatar_url":"https://github.com/cofin.png","language":"Python","funding_links":[],"categories":["Third-Party Extensions"],"sub_categories":["General"],"readme":"# Litestar Granian Plugin\n\n## Installation\n\n```shell\npip install litestar-granian\n```\n\n## Usage\n\nHere is a basic application that demonstrates how to use the plugin.\n\n```python\nfrom __future__ import annotations\n\nfrom litestar import Controller, Litestar, get\n\nfrom litestar_granian import GranianPlugin\n\n\nclass SampleController(Controller):\n    @get(path=\"/sample\")\n    async def sample_route(self ) -\u003e dict[str, str]:\n        \"\"\"Sample Route.\"\"\"\n        return {\"sample\": \"hello-world\"}\n\n\napp = Litestar(plugins=[GranianPlugin()], route_handlers=[SampleController])\n\n```\n\nNow, you can use the standard Litestar CLI and it will run with Granian instead of Uvicorn.\n\n```shell\n❯ litestar --app examples.basic:app run\nUsing Litestar app from env: 'examples.basic:app'\nStarting granian server process ──────────────────────────────────────────────\n┌──────────────────────────────┬──────────────────────┐\n│ Litestar version             │ 2.1.1                │\n│ Debug mode                   │ Disabled             │\n│ Python Debugger on exception │ Disabled             │\n│ CORS                         │ Disabled             │\n│ CSRF                         │ Disabled             │\n│ OpenAPI                      │ Enabled path=/schema │\n│ Compression                  │ Disabled             │\n└──────────────────────────────┴──────────────────────┘\n[INFO] Starting granian\n[INFO] Listening at: 127.0.0.1:8000\n[INFO] Spawning worker-1 with pid: 2719082\n[INFO] Started worker-1\n[INFO] Started worker-1 runtime-1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcofin%2Flitestar-granian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcofin%2Flitestar-granian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcofin%2Flitestar-granian/lists"}