Name | pyzusi3 JSON |
Version |
3.1.0
JSON |
| download |
home_page | None |
Summary | Zusi3 TCP Client library with async support and no deps |
upload_time | 2024-07-04 21:32:58 |
maintainer | None |
docs_url | None |
author | None |
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)
## AutoSifa Tool
Can be downloaded here, built as one file python executable, digitally signed
![ZusiData](https://github.com/jokey2k/pyzusi3/blob/main/examples/autosifa/screenshot.png?raw=true)
## PySide6 UI
![ZusiData](https://github.com/jokey2k/pyzusi3/blob/main/examples/pyzusidisplay/screenshot.png?raw=true)
Raw data
{
"_id": null,
"home_page": null,
"name": "pyzusi3",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10.7",
"maintainer_email": null,
"keywords": "tcp, async",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/91/5b/88a6202039d227fc2cb4c584cfe6ec9af3558550a966633eda1e94f12685/pyzusi3-3.1.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## AutoSifa Tool\r\nCan be downloaded here, built as one file python executable, digitally signed\r\n![ZusiData](https://github.com/jokey2k/pyzusi3/blob/main/examples/autosifa/screenshot.png?raw=true)\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": "3.1.0",
"project_urls": null,
"split_keywords": [
"tcp",
" async"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cefb8467920bce0c894d31e96e5656e502446d78e2a616accc2768fff6f8e7f6",
"md5": "abb84d76515acc96e5921c5a95a11430",
"sha256": "f68d6d9ed5e0112459fe019eb9135509dc12b2b4cde32686637eff8939d07c76"
},
"downloads": -1,
"filename": "pyzusi3-3.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "abb84d76515acc96e5921c5a95a11430",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10.7",
"size": 39367,
"upload_time": "2024-07-04T21:32:56",
"upload_time_iso_8601": "2024-07-04T21:32:56.443838Z",
"url": "https://files.pythonhosted.org/packages/ce/fb/8467920bce0c894d31e96e5656e502446d78e2a616accc2768fff6f8e7f6/pyzusi3-3.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "915b88a6202039d227fc2cb4c584cfe6ec9af3558550a966633eda1e94f12685",
"md5": "4301e079e788c1eb821874b83dfa31dc",
"sha256": "3bc8bacb17ac3600d51ee0b6b38e4c85a4c0fa988ecb713fbe93f6329ff8e6ab"
},
"downloads": -1,
"filename": "pyzusi3-3.1.0.tar.gz",
"has_sig": false,
"md5_digest": "4301e079e788c1eb821874b83dfa31dc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10.7",
"size": 182829,
"upload_time": "2024-07-04T21:32:58",
"upload_time_iso_8601": "2024-07-04T21:32:58.251734Z",
"url": "https://files.pythonhosted.org/packages/91/5b/88a6202039d227fc2cb4c584cfe6ec9af3558550a966633eda1e94f12685/pyzusi3-3.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-04 21:32:58",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyzusi3"
}