Skip to main content

Yay! API client SDK

Project description

yaylib

yaylib

好きでつながるバーチャルワールド - Yay! の API ライブラリ

Python

あらゆる操作の自動化や、ボットの開発が可能です。

Discord に参加

Yay! の API を Python から扱うための非公式 SDK です。

インストール

pip install yaylib

対応バージョン: Python 3.10 / 3.11 / 3.12 / 3.13

クイックスタート

import asyncio
import yaylib


async def main():
    client = yaylib.Client()

    # ログイン(セッションは透過的にキャッシュされます)
    await client.login_with_email(email="...", password="...")

    # おすすめタイムラインを取得
    timeline = await client.get_recommended_timeline(number=20)
    for post in timeline.posts:
        print(post.id, post.text)

    # 投稿する
    await client.create_post(
        x_jwt=client.generate_x_jwt(),
        post_type="text",
        text="hello from yaylib",
    )


asyncio.run(main())

すべてのオペレーションは client.<operation> として直接呼び出せます。

イベントストリーム

async with client.open_event_stream() as stream:
    sub = stream.subscribe(yaylib.chat_room_channel())

    # 新着メッセージを受信
    @sub.on_new_message
    async def _(event):
        print("new message:", event)

    await sub.wait_closed()

⚖️ ライセンス

MIT © ekkx

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

yaylib-2.0.0rc1.tar.gz (266.3 kB view details)

Uploaded Source

Built Distribution

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

yaylib-2.0.0rc1-py3-none-any.whl (860.7 kB view details)

Uploaded Python 3

File details

Details for the file yaylib-2.0.0rc1.tar.gz.

File metadata

  • Download URL: yaylib-2.0.0rc1.tar.gz
  • Upload date:
  • Size: 266.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yaylib-2.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 53c9e1dbd7f7587a58b13e9bf572c216cf83d85e8cc3a6e52d6e59760fdfa3f7
MD5 ab4629f48f24abcfbdbf209199c1d898
BLAKE2b-256 425897e3e6582bc0e23b52719d94f50649dd66f7b7b4dc873ef03ab9f3adc76b

See more details on using hashes here.

File details

Details for the file yaylib-2.0.0rc1-py3-none-any.whl.

File metadata

  • Download URL: yaylib-2.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 860.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yaylib-2.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6a1ff84ad7ae69c908a51cc058bf0651dd7513b3c8295cdde41f7c39ed417a2
MD5 012646b18670cc3a204b06e509e7d092
BLAKE2b-256 e74d581fdebda4b020565bf5e43d9ba00d97ce741d1a23afbb31db1b7d41db0c

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