This is an API wrapper for a PHP software called uwuzu.
Project description
uwuzu.py
Uwuzu SNSのAPIをPythonから簡単に操作するための、高機能で直感的なラッパーライブラリです。 APIの全エンドポイントを網羅し、Bot開発から管理者ツール作成まで幅広く対応しています。
特徴
- フルサポート: APIドキュメントにある23種類すべてのエンドポイントに対応。
- オブジェクト指向: 投稿やユーザーをオブジェクトとして扱い、直感的な操作が可能。
- 画像送信対応: Base64エンコードを意識せず、ファイルパスを指定するだけで画像投稿が可能。
- Bot向け機能: タイムラインの常時監視(ストリーミング風)や自動ページ送り機能を搭載。
インストール
GitHubから直接インストールする場合:
pip install git+[https://github.com/uargument3384/uwuzu.py.git](https://github.com/uargument3384/uwuzu.py.git)
クイックスタート
1. 初期化と自分の情報取得
from uwuzu import Uwuzu
client = Uwuzu("your-instance.net", "your-access-token")
me = client.get_me()
print(f"Logged in as: {me.name} (@{me.id})")
2. 投稿(Ueuse)の操作
# テキスト投稿
client.create_post("Hello Uwuzu.py!")
# 画像付き投稿 (最大4枚)
client.create_post("景色が綺麗です", image_paths=["scenery.jpg"])
# タイムラインの取得と反応
timeline = client.get_timeline(limit=5)
for post in timeline:
print(f"{post.author.name}: {post.text_content}")
# 投稿に対してアクション
post.favorite() # いいね
post.reply("素敵な投稿ですね!") # 返信
3. ユーザーのフォロー・管理
# ユーザーを検索してフォロー
user = client.get_user("target_user_id")
user.follow()
4. リアルタイム監視 (Bot機能)
タイムラインを監視して、特定のキーワードに自動応答するBotを簡単に作成できます。
def on_post(post):
if "こんにちは" in post.text_content:
post.reply("こんにちは!自動返信です。")
# 60秒ごとに新着投稿をチェック
client.watch_timeline(interval=60, callback=on_post)
管理者向け機能
※管理者権限を持つトークンが必要です。
# ユーザー詳細の取得(IPアドレス等を含む)
admin_user = client.admin_get_user("target_id")
# ユーザーの凍結・BAN
client.admin_sanction(userid="bad_user", type="frozen", message="規約違反")
# 通報の確認と解決
reports = client.admin_get_reports()
client.admin_resolve_report(reported_userid="bad_user")
ライセンス
MIT License - 詳細は LICENSE ファイルをご覧ください。
作者
* nd2ew9
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
uwuzu_py-0.1.0.tar.gz
(6.1 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
File details
Details for the file uwuzu_py-0.1.0.tar.gz.
File metadata
- Download URL: uwuzu_py-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b2e801957a5ee9e4131cdc48164c4b6d7eac89d8859f246dc3654bc3a86d002
|
|
| MD5 |
78ba2ee427a7597f88571714897430d0
|
|
| BLAKE2b-256 |
34d4971f2aee02c2a00c7162b14669f5ef7d076e6c85f5844e73db2c449a8861
|
File details
Details for the file uwuzu_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: uwuzu_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bf51610358034fb81174ec57c332c4806f912bfa6bd4012c1d634420ae378f4
|
|
| MD5 |
c01b3de65c83a9083b295ed8cdb8ec13
|
|
| BLAKE2b-256 |
8e74a0750b4a2404fd87f7e8e1c73d85feed2ff63a31d01da5c4df9353b66ef7
|