Metadata-Version: 2.4
Name: uwuzu.py
Version: 0.1.0
Summary: This is an API wrapper for a PHP software called uwuzu.
Author-email: nd2ew9 <admin@argument3384.online>
License: MIT
Project-URL: Homepage, https://github.com/uargunent3384/uwuzu.py
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: license-file


# uwuzu.py

[![PyPI version](https://img.shields.io/pypi/v/uwuzu.py.svg)](https://pypi.org/project/uwuzu.py/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Uwuzu SNSのAPIをPythonから簡単に操作するための、高機能で直感的なラッパーライブラリです。
APIの全エンドポイントを網羅し、Bot開発から管理者ツール作成まで幅広く対応しています。

## 特徴

- **フルサポート**: APIドキュメントにある23種類すべてのエンドポイントに対応。
- **オブジェクト指向**: 投稿やユーザーをオブジェクトとして扱い、直感的な操作が可能。
- **画像送信対応**: Base64エンコードを意識せず、ファイルパスを指定するだけで画像投稿が可能。
- **Bot向け機能**: タイムラインの常時監視（ストリーミング風）や自動ページ送り機能を搭載。

## インストール

GitHubから直接インストールする場合：
```bash
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
