Name | litestar-granian JSON |
Version |
0.14.2
JSON |
| download |
home_page | None |
Summary | Granian plugin for Litestar |
upload_time | 2025-08-06 19:54:57 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT |
keywords |
asgi
granian
litestar
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Litestar Granian Plugin
## Installation
```shell
pip install litestar-granian
```
## Usage
Here is a basic application that demonstrates how to use the plugin.
```python
from __future__ import annotations
from litestar import Controller, Litestar, get
from litestar_granian import GranianPlugin
class SampleController(Controller):
@get(path="/sample")
async def sample_route(self ) -> dict[str, str]:
"""Sample Route."""
return {"sample": "hello-world"}
app = Litestar(plugins=[GranianPlugin()], route_handlers=[SampleController])
```
Now, you can use the standard Litestar CLI and it will run with Granian instead of Uvicorn.
```shell
❯ litestar --app examples.basic:app run
Using Litestar app from env: 'examples.basic:app'
Starting granian server process ──────────────────────────────────────────────
┌──────────────────────────────┬──────────────────────┐
│ Litestar version │ 2.1.1 │
│ Debug mode │ Disabled │
│ Python Debugger on exception │ Disabled │
│ CORS │ Disabled │
│ CSRF │ Disabled │
│ OpenAPI │ Enabled path=/schema │
│ Compression │ Disabled │
└──────────────────────────────┴──────────────────────┘
[INFO] Starting granian
[INFO] Listening at: 127.0.0.1:8000
[INFO] Spawning worker-1 with pid: 2719082
[INFO] Started worker-1
[INFO] Started worker-1 runtime-1
```
Raw data
{
"_id": null,
"home_page": null,
"name": "litestar-granian",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "asgi, granian, litestar",
"author": null,
"author_email": "Cody Fincher <cody@litestar.dev>",
"download_url": "https://files.pythonhosted.org/packages/6f/98/f0347c427819ad53c5d51a4ca9ca127fe69fe985663bb926ad9cc056cd91/litestar_granian-0.14.2.tar.gz",
"platform": null,
"description": "# 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 ) -> 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\u276f litestar --app examples.basic:app run\nUsing Litestar app from env: 'examples.basic:app'\nStarting granian server process \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Litestar version \u2502 2.1.1 \u2502\n\u2502 Debug mode \u2502 Disabled \u2502\n\u2502 Python Debugger on exception \u2502 Disabled \u2502\n\u2502 CORS \u2502 Disabled \u2502\n\u2502 CSRF \u2502 Disabled \u2502\n\u2502 OpenAPI \u2502 Enabled path=/schema \u2502\n\u2502 Compression \u2502 Disabled \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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",
"bugtrack_url": null,
"license": "MIT",
"summary": "Granian plugin for Litestar",
"version": "0.14.2",
"project_urls": {
"Changelog": "https://cofin.github.io/litesatr-granian/latest/changelog",
"Discord": "https://discord.gg/X3FJqy8d2j",
"Documentation": "https://cofin.github.io/litesatr-granian/latest/",
"Homepage": "https://cofin.github.io/litesatr-granian/latest/",
"Issue": "https://github.com/cofin/litestar-granian/issues/",
"Source": "https://github.com/cofin/litestar-granian"
},
"split_keywords": [
"asgi",
" granian",
" litestar"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8810e592fa6747d707f9488685d4a1a8b0a165f2be5276d4600bf8aee49e4f35",
"md5": "75f02776716963ac3cae3197e2fcb9ac",
"sha256": "fd85759846622ee83ffde87f832b3f5e8656eb8e4b76ee7b13e543ef10bea402"
},
"downloads": -1,
"filename": "litestar_granian-0.14.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "75f02776716963ac3cae3197e2fcb9ac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 13263,
"upload_time": "2025-08-06T19:54:56",
"upload_time_iso_8601": "2025-08-06T19:54:56.171302Z",
"url": "https://files.pythonhosted.org/packages/88/10/e592fa6747d707f9488685d4a1a8b0a165f2be5276d4600bf8aee49e4f35/litestar_granian-0.14.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6f98f0347c427819ad53c5d51a4ca9ca127fe69fe985663bb926ad9cc056cd91",
"md5": "4907c8e8906f2b3c91f07afb8e3a7919",
"sha256": "24d7d57349d9514ce680aff76bc295b157522c436b09e365d4805f0ad6c33444"
},
"downloads": -1,
"filename": "litestar_granian-0.14.2.tar.gz",
"has_sig": false,
"md5_digest": "4907c8e8906f2b3c91f07afb8e3a7919",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 169317,
"upload_time": "2025-08-06T19:54:57",
"upload_time_iso_8601": "2025-08-06T19:54:57.629990Z",
"url": "https://files.pythonhosted.org/packages/6f/98/f0347c427819ad53c5d51a4ca9ca127fe69fe985663bb926ad9cc056cd91/litestar_granian-0.14.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-06 19:54:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cofin",
"github_project": "litestar-granian",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "litestar-granian"
}