Yay! API client SDK
Project description
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_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()
⚖️ ライセンス
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.0rc3.tar.gz
(267.5 kB
view details)
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
yaylib-2.0.0rc3-py3-none-any.whl
(862.0 kB
view details)
File details
Details for the file yaylib-2.0.0rc3.tar.gz.
File metadata
- Download URL: yaylib-2.0.0rc3.tar.gz
- Upload date:
- Size: 267.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baa584aa79dd76e02deb541c751dde14849ce7f85f18e30ee1685200b91cb028
|
|
| MD5 |
93d729ae44bd94bbc5e3b2b4e005a727
|
|
| BLAKE2b-256 |
0377343a9f035e5b6a8d9f615f4213f3acddf66510f3b490f34d223ad5d3eb2a
|
File details
Details for the file yaylib-2.0.0rc3-py3-none-any.whl.
File metadata
- Download URL: yaylib-2.0.0rc3-py3-none-any.whl
- Upload date:
- Size: 862.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
073f0a415864478daf39b2654758d18020cc165ca5ae2c96b57f3ef088127398
|
|
| MD5 |
94812bb4d5a71bce4185908a3d5bb8f1
|
|
| BLAKE2b-256 |
27fe52ed0c76338792bbe720e51f8412b30b0ee9e29c0bd2f7f62ea3f58d2ba5
|