Basic library to interract with Kyodo
Project description
py.kyodo
Basic library to talk with Kyodo servers. Based on HTTPX and websockets libraries.
Important notices
This lib is async only.
This lib is only demonstration and contain basic things. Please consider to take it as research object that can be improved. Thanks in advance.
PRs and issues are welcome.
Basic example
import logging
from asyncio import run
from datetime import datetime
from kyodo import Client, Socket
from kyodo.utils.objects import Message
async def process_message(client: Client, message: Message) -> None:
# do smth with messages, idk
async def main():
logging.basicConfig(
level=logging.INFO,
filename="logs/{}.log".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S")),
format="[%(asctime)s / %(levelname)s] %(name)s -> %(message)s",
)
logging.info("Configuration loaded...")
client = Client()
await client.login(email, password)
logging.info("Client logged in...")
socket = Socket(client, process_message)
logging.info("Socket initialized, starting listening...")
print("Starting now!")
await socket.listen_forever()
try:
run(main())
except KeyboardInterrupt:
logging.info("KeyboardInterrupt received, exiting...")
print("Exiting...")
exit(0)
Project details
Release history Release notifications | RSS feed
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 py_kyodo-1.0.1.tar.gz.
File metadata
- Download URL: py_kyodo-1.0.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cab09a72e4926e3600e85adbf99de5529438131ee3d9da2d467342d285a139a9
|
|
| MD5 |
c25c9da0026c728e0f1831e494535f69
|
|
| BLAKE2b-256 |
3a06e2c17e49b5a5ebf652d54dce0ec30c4b4108d7fd00442cb68554877803b0
|
File details
Details for the file py_kyodo-1.0.1-py3-none-any.whl.
File metadata
- Download URL: py_kyodo-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1029f5665676aafff6478e181a69a1d7bf9e6c1a6ea34d5df0c5fe3f74bee24
|
|
| MD5 |
e1c63d3aa5369822bfedec79c4aaef3c
|
|
| BLAKE2b-256 |
a0d290680b34fe8f26b00d046ff35527526d085a671fd06e2b964388d5214ce7
|