Name | async-websocket-client JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | |
upload_time | 2023-06-01 21:32:45 |
maintainer | |
docs_url | None |
author | irocshers |
requires_python | >=3.8,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Async WebSocket client
A module that implements an asynchronous interface based on [websockets](https://github.com/python-websockets/websockets) for working with websockets
[](https://pypi.org/project/async-websocket-client/)
[](https://pypi.org/project/async-websocket-client/)
[](https://gitlab.com/rocshers/python/async-websocket-client)
[](https://codecov.io/gitlab/rocshers:python/async-websocket-client)
[](https://pepy.tech/project/async-websocket-client)
[](https://gitlab.com/rocshers/python/async-websocket-client)
## Functionality
- Регистрация / Удаление WS
- Создание / Удаление групп WS
- Подключение WS в группу
- Поддержка реестров: memory, redis
## Quick start
Установка:
```sh
pip install async-websocket-client
```
Подключение:
```python
import asyncio
from async_websocket_client.apps import AsyncWebSocketApp
from async_websocket_client.dispatchers import BaseDispatcher
class SomeDispatcher(BaseDispatcher):
async def on_connect(self):
return await self.ws.send('hello, server')
async def on_message(self, message: str):
return await self.ws.send(f'server, I received your message. len(message)=={len(message)}')
client = AsyncWebSocketApp('ws://localhost:8001/ws', SomeDispatcher())
client.asyncio_run() # quick run
# or
asyncio.run(client.run()) # Run with asyncio
```
Raw data
{
"_id": null,
"home_page": "",
"name": "async-websocket-client",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "irocshers",
"author_email": "develop.iam@rocshers.com",
"download_url": "https://files.pythonhosted.org/packages/a2/b7/1125e4a937b7a8aaf2b9ad09c58810660f4812afa88c323646d64bb4d776/async_websocket_client-0.1.0.tar.gz",
"platform": null,
"description": "# Async WebSocket client\n\nA module that implements an asynchronous interface based on [websockets](https://github.com/python-websockets/websockets) for working with websockets\n\n[](https://pypi.org/project/async-websocket-client/)\n[](https://pypi.org/project/async-websocket-client/)\n[](https://gitlab.com/rocshers/python/async-websocket-client)\n\n[](https://codecov.io/gitlab/rocshers:python/async-websocket-client)\n[](https://pepy.tech/project/async-websocket-client)\n[](https://gitlab.com/rocshers/python/async-websocket-client)\n\n## Functionality\n\n- \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f / \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 WS\n- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 / \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f WS\n- \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 WS \u0432 \u0433\u0440\u0443\u043f\u043f\u0443\n- \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u0432: memory, redis\n\n## Quick start\n\n\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:\n\n```sh\npip install async-websocket-client\n```\n\n\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:\n\n```python\nimport asyncio\nfrom async_websocket_client.apps import AsyncWebSocketApp\nfrom async_websocket_client.dispatchers import BaseDispatcher\n\nclass SomeDispatcher(BaseDispatcher):\n async def on_connect(self):\n return await self.ws.send('hello, server')\n\n async def on_message(self, message: str):\n return await self.ws.send(f'server, I received your message. len(message)=={len(message)}')\n\nclient = AsyncWebSocketApp('ws://localhost:8001/ws', SomeDispatcher())\nclient.asyncio_run() # quick run\n# or\nasyncio.run(client.run()) # Run with asyncio\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9f2cc52519f3a461f745169cdcb0914710a73fa0c519676da0a02d3d89554d87",
"md5": "de8633b134f903ac16410eb56d93a529",
"sha256": "1219d707df5c403542f37ca4784ca375f8c8ad62b06d81ccdb250dfe96568bbf"
},
"downloads": -1,
"filename": "async_websocket_client-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "de8633b134f903ac16410eb56d93a529",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 4270,
"upload_time": "2023-06-01T21:32:44",
"upload_time_iso_8601": "2023-06-01T21:32:44.028247Z",
"url": "https://files.pythonhosted.org/packages/9f/2c/c52519f3a461f745169cdcb0914710a73fa0c519676da0a02d3d89554d87/async_websocket_client-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a2b71125e4a937b7a8aaf2b9ad09c58810660f4812afa88c323646d64bb4d776",
"md5": "7792147af04bd45d85f1e4a9f99845b8",
"sha256": "b7bfce4b42328e35604a692eff80e000e96a05facacfb4b7b051f0b654237eb9"
},
"downloads": -1,
"filename": "async_websocket_client-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7792147af04bd45d85f1e4a9f99845b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 3633,
"upload_time": "2023-06-01T21:32:45",
"upload_time_iso_8601": "2023-06-01T21:32:45.100435Z",
"url": "https://files.pythonhosted.org/packages/a2/b7/1125e4a937b7a8aaf2b9ad09c58810660f4812afa88c323646d64bb4d776/async_websocket_client-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-01 21:32:45",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "async-websocket-client"
}