Zusi3 TCP Client library with async support and no deps
Project description
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
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
AutoSifa Tool
Can be downloaded here, built as one file python executable, digitally signed
PySide6 UI
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyzusi3-3.1.0.tar.gz.
File metadata
- Download URL: pyzusi3-3.1.0.tar.gz
- Upload date:
- Size: 182.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bc8bacb17ac3600d51ee0b6b38e4c85a4c0fa988ecb713fbe93f6329ff8e6ab
|
|
| MD5 |
4301e079e788c1eb821874b83dfa31dc
|
|
| BLAKE2b-256 |
915b88a6202039d227fc2cb4c584cfe6ec9af3558550a966633eda1e94f12685
|
File details
Details for the file pyzusi3-3.1.0-py3-none-any.whl.
File metadata
- Download URL: pyzusi3-3.1.0-py3-none-any.whl
- Upload date:
- Size: 39.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f68d6d9ed5e0112459fe019eb9135509dc12b2b4cde32686637eff8939d07c76
|
|
| MD5 |
abb84d76515acc96e5921c5a95a11430
|
|
| BLAKE2b-256 |
cefb8467920bce0c894d31e96e5656e502446d78e2a616accc2768fff6f8e7f6
|