Skip to main content

Basic library to interract with Kyodo

Project description

py.kyodo

PyPi Version Python Version Issues Pull requests

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)

Discord server

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

py_kyodo-1.0.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_kyodo-1.0.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

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

Hashes for py_kyodo-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cab09a72e4926e3600e85adbf99de5529438131ee3d9da2d467342d285a139a9
MD5 c25c9da0026c728e0f1831e494535f69
BLAKE2b-256 3a06e2c17e49b5a5ebf652d54dce0ec30c4b4108d7fd00442cb68554877803b0

See more details on using hashes here.

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

Hashes for py_kyodo-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1029f5665676aafff6478e181a69a1d7bf9e6c1a6ea34d5df0c5fe3f74bee24
MD5 e1c63d3aa5369822bfedec79c4aaef3c
BLAKE2b-256 a0d290680b34fe8f26b00d046ff35527526d085a671fd06e2b964388d5214ce7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page