Name | litestar-socketify JSON |
Version |
0.1.1
JSON |
| download |
home_page | |
Summary | socketify plugin for Litestar |
upload_time | 2023-10-04 03:48:55 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8 |
license | MIT |
keywords |
asgi
litestar
socketify
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Litestar Socketify Plugin
> [!WARNING]
> Socketify currently has an issue with [ASGI lifespans](https://github.com/cirospaciari/socketify.py/issues/135). This plugin should be considered experimental.
## Installation
```shell
pip install litestar-socketify
```
## 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_socketify import SocketifyPlugin
class SampleController(Controller):
@get(path="/sample")
async def sample_route(self ) -> dict[str, str]:
"""Sample Route."""
return {"sample": "hello-world"}
app = Litestar(plugins=[SocketifyPlugin()], route_handlers=[SampleController])
```
Now, you can use the standard Litestar CLI and it will run with Socketify instead of Uvicorn.
```shell
❯ litestar --app examples.basic:app run
Using Litestar app from env: 'examples.basic:app'
Starting socketify 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 │
└──────────────────────────────┴──────────────────────┘
...
```
Raw data
{
"_id": null,
"home_page": "",
"name": "litestar-socketify",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "asgi,litestar,socketify",
"author": "",
"author_email": "Cody Fincher <cody.fincher@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/4a/2d/7d3e148cb8e94a399bd7eec0a9df3bcf2a7116f1e359456feb185b0464ef/litestar_socketify-0.1.1.tar.gz",
"platform": null,
"description": "# Litestar Socketify Plugin\n\n> [!WARNING]\n> Socketify currently has an issue with [ASGI lifespans](https://github.com/cirospaciari/socketify.py/issues/135). This plugin should be considered experimental.\n\n## Installation\n\n```shell\npip install litestar-socketify\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_socketify import SocketifyPlugin\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=[SocketifyPlugin()], route_handlers=[SampleController])\n\n```\n\nNow, you can use the standard Litestar CLI and it will run with Socketify instead of Uvicorn.\n\n```shell\n\u276f litestar --app examples.basic:app run\nUsing Litestar app from env: 'examples.basic:app'\nStarting socketify 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...\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "socketify plugin for Litestar",
"version": "0.1.1",
"project_urls": {
"Changelog": "https://cofin.github.io/litesatr-socketify/latest/changelog",
"Discord": "https://discord.gg/X3FJqy8d2j",
"Documentation": "https://cofin.github.io/litesatr-socketify/latest/",
"Homepage": "https://cofin.github.io/litesatr-socketify/latest/",
"Issue": "https://github.com/cofin/litestar-socketify/issues/",
"Source": "https://github.com/cofin/litestar-socketify"
},
"split_keywords": [
"asgi",
"litestar",
"socketify"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4481c95da29ff458f2ecc91bec1185c47f743332802ced5ff07ff8e67b6dca7c",
"md5": "3d6e4de4e1fb7a52d8230fa1e302cccb",
"sha256": "edbe9ce2cb7230f36a1fc65e159a655010fe808dc33af1cf24d96a8012752e19"
},
"downloads": -1,
"filename": "litestar_socketify-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3d6e4de4e1fb7a52d8230fa1e302cccb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5325,
"upload_time": "2023-10-04T03:48:54",
"upload_time_iso_8601": "2023-10-04T03:48:54.103953Z",
"url": "https://files.pythonhosted.org/packages/44/81/c95da29ff458f2ecc91bec1185c47f743332802ced5ff07ff8e67b6dca7c/litestar_socketify-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4a2d7d3e148cb8e94a399bd7eec0a9df3bcf2a7116f1e359456feb185b0464ef",
"md5": "282fddd9db1fa2397bbfc28231e6da58",
"sha256": "7b7d17b4144eb3343938ff1f7c2fe0c4bc5d5a4a43b2695ee763d18641b1eeea"
},
"downloads": -1,
"filename": "litestar_socketify-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "282fddd9db1fa2397bbfc28231e6da58",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 71655,
"upload_time": "2023-10-04T03:48:55",
"upload_time_iso_8601": "2023-10-04T03:48:55.623386Z",
"url": "https://files.pythonhosted.org/packages/4a/2d/7d3e148cb8e94a399bd7eec0a9df3bcf2a7116f1e359456feb185b0464ef/litestar_socketify-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-04 03:48:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cofin",
"github_project": "litestar-socketify",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "litestar-socketify"
}