Name | pyzusi3 JSON |
Version |
2.0.0
JSON |
| download |
home_page | |
Summary | Zusi3 TCP Client library with async support and no deps |
upload_time | 2023-02-09 12:11:50 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.10.7 |
license | BSD 3-Clause License |
keywords |
tcp
async
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# WARNING
Zusi 3.5 introduced breaking changes without increasing API version, so ensure to use pyzusi 1.2.1 for Zusi 3.4 and below
# pyzusi3
Library to talk to Zusi3 without any specialized purpose.
Intentionally the message parameters are taken almost word-by-word from Zusi documentation to make using the lib easier.
So be prepared for some mixing of code language (english) and zusi-lib language (german).
# Examples
## Minimal code example
```python
import asyncio
async def print_state(client):
while True:
print(client.local_state)
asyncio.sleep(1)
tasks = []
async def main(ip, port):
client = ZusiClient(ip, port, "pyzusi3 demo", "1.0")
client.request_status(displays=[
messages.FAHRPULT_ANZEIGEN.GESCHWINDIGKEIT,
messages.FAHRPULT_ANZEIGEN.STATUS_SIFA
],
programdata=[
messages.PROGRAMMDATEN.ZUGDATEI,
messages.PROGRAMMDATEN.ZUGNUMMER
]
)
main_task = asyncio.create_task(client.connect())
tasks.append(main_task)
watch_task = asyncio.create_task(print_state(client))
tasks.append(watch_task)
if __name__ == "__main__":
run_loop = asyncio.new_event_loop()
run_loop.create_task(main(ZUSI_IP, ZUSI_PORT))
run_loop.run_forever()
```
## Interaction simulation
see [interactiondemo.py](https://github.com/jokey2k/pyzusi3/blob/main/examples/interactiondemo.py)
## PySide6 UI
![ZusiData](https://github.com/jokey2k/pyzusi3/blob/main/examples/pyzusidisplay/screenshot.png?raw=true)
Raw data
{
"_id": null,
"home_page": "",
"name": "pyzusi3",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10.7",
"maintainer_email": "",
"keywords": "tcp,async",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/36/cb/077940847196ddc5b6ed6f7b16ba6e250408f8f6aa1e7e29dc1a4fed0f32/pyzusi3-2.0.0.tar.gz",
"platform": null,
"description": "# WARNING\r\nZusi 3.5 introduced breaking changes without increasing API version, so ensure to use pyzusi 1.2.1 for Zusi 3.4 and below\r\n\r\n# pyzusi3\r\nLibrary to talk to Zusi3 without any specialized purpose.\r\n\r\nIntentionally the message parameters are taken almost word-by-word from Zusi documentation to make using the lib easier.\r\nSo be prepared for some mixing of code language (english) and zusi-lib language (german).\r\n\r\n# Examples\r\n\r\n## Minimal code example\r\n```python\r\nimport asyncio\r\n\r\nasync def print_state(client):\r\n while True:\r\n print(client.local_state)\r\n asyncio.sleep(1)\r\n\r\ntasks = []\r\nasync def main(ip, port):\r\n client = ZusiClient(ip, port, \"pyzusi3 demo\", \"1.0\")\r\n client.request_status(displays=[\r\n messages.FAHRPULT_ANZEIGEN.GESCHWINDIGKEIT,\r\n messages.FAHRPULT_ANZEIGEN.STATUS_SIFA\r\n ],\r\n programdata=[\r\n messages.PROGRAMMDATEN.ZUGDATEI,\r\n messages.PROGRAMMDATEN.ZUGNUMMER\r\n ]\r\n )\r\n\r\n main_task = asyncio.create_task(client.connect())\r\n tasks.append(main_task)\r\n\r\n watch_task = asyncio.create_task(print_state(client))\r\n tasks.append(watch_task)\r\n\r\nif __name__ == \"__main__\":\r\n run_loop = asyncio.new_event_loop()\r\n run_loop.create_task(main(ZUSI_IP, ZUSI_PORT))\r\n run_loop.run_forever()\r\n```\r\n\r\n## Interaction simulation\r\nsee [interactiondemo.py](https://github.com/jokey2k/pyzusi3/blob/main/examples/interactiondemo.py)\r\n\r\n## PySide6 UI\r\n![ZusiData](https://github.com/jokey2k/pyzusi3/blob/main/examples/pyzusidisplay/screenshot.png?raw=true)\r\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Zusi3 TCP Client library with async support and no deps",
"version": "2.0.0",
"split_keywords": [
"tcp",
"async"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc560bc36023c4b4542fe2a8801fe2314e89f94dc8b2b1ef41b14e0151b91f2f",
"md5": "cb59445b665ccb15ddc616f944baab37",
"sha256": "b9921b8ed6c7aa93dce8985c7de4082c6286dba49d0bf24af87b0e8fe59a57c1"
},
"downloads": -1,
"filename": "pyzusi3-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cb59445b665ccb15ddc616f944baab37",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10.7",
"size": 37872,
"upload_time": "2023-02-09T12:11:46",
"upload_time_iso_8601": "2023-02-09T12:11:46.898138Z",
"url": "https://files.pythonhosted.org/packages/bc/56/0bc36023c4b4542fe2a8801fe2314e89f94dc8b2b1ef41b14e0151b91f2f/pyzusi3-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "36cb077940847196ddc5b6ed6f7b16ba6e250408f8f6aa1e7e29dc1a4fed0f32",
"md5": "329ea57e8c7503174e99803bb1aefb84",
"sha256": "aac7e20f41929d5ed2d69825fd88d93c5ddefb8592c6430784a70dd83422440e"
},
"downloads": -1,
"filename": "pyzusi3-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "329ea57e8c7503174e99803bb1aefb84",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10.7",
"size": 91360,
"upload_time": "2023-02-09T12:11:50",
"upload_time_iso_8601": "2023-02-09T12:11:50.567023Z",
"url": "https://files.pythonhosted.org/packages/36/cb/077940847196ddc5b6ed6f7b16ba6e250408f8f6aa1e7e29dc1a4fed0f32/pyzusi3-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-09 12:11:50",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "pyzusi3"
}