Skip to main content
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():
    # `async with` で接続が自動的にクローズされます
    async with yaylib.Client() as client:
        # ログイン(セッションは透過的にキャッシュされます)
        await client.login_with_email(email="...", password="...")

        # タイムラインを取得
        timeline = await client.get_timeline(
            noreply_mode=yaylib.NoreplyMode.EMPTY, 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()

サンプル

実行できるサンプルを examples/ に用意しています(全言語共通)。

  • 認証 + タイムライン取得
  • テキスト投稿
  • イベントストリームの簡単なボット
  • セッション永続化とエラー処理
YAY_EMAIL=... YAY_PASSWORD=... python examples/python/timeline.py

⚖️ ライセンス

MIT © ekkx

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.3.0.tar.gz (274.2 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.3.0-py3-none-any.whl (869.7 kB view details)

Uploaded Python 3

File details

Details for the file yaylib-2.3.0.tar.gz.

File metadata

  • Download URL: yaylib-2.3.0.tar.gz
  • Upload date:
  • Size: 274.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for yaylib-2.3.0.tar.gz
Algorithm Hash digest
SHA256 7350ef2382f77168f6e3e7e8941dc8ffa27f4e9a23160cf3cd2462c56247ce31
MD5 2c42749209086813d3491c78f1f724ba
BLAKE2b-256 466738b9184058f14a7e3359a6c941580f82ac22ab7734edbba509889ddb6063

See more details on using hashes here.

File details

Details for the file yaylib-2.3.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for yaylib-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ded6dd932ef194049a4414b0cf9bef6755269c1b1a58f200af1d1a2362c312a
MD5 cd4456053037f01d5b195e86451c71bd
BLAKE2b-256 e60fc4b29b08fb64e016667590c4d8569cb0e933a2b2e1fea94f0be1c03732a6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.15

2 files

1.4.14

2 files

1.4.13

2 files

1.4.12

2 files

1.4.11

2 files

1.4.10

2 files

1.4.9

2 files

1.4.8

2 files

1.4.7

2 files

1.4.6

2 files

1.4.5

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

1 file

1.4.0

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.9

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.5

2 files

0.1.3

2 files

0.1.2

2 files

0.1.0

2 files

0.0.0

2 files

Supported by

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