Skip to main content

This is an API wrapper for a PHP software called uwuzu.

Project description

uwuzu.py

PyPI version License: MIT

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


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.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

uwuzu_py-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file uwuzu_py-0.1.1.tar.gz.

File metadata

  • Download URL: uwuzu_py-0.1.1.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

Hashes for uwuzu_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6f36219782943e392e9cc23a6c510c420c588a14e27274feb0dd2470ccc6eb30
MD5 2a60fb9aa2bf11c04bd57a629cfd90d2
BLAKE2b-256 2e5e525c4689bcbfa5fbd8efd6ec3af5842987abed184777badfdcd714b09a67

See more details on using hashes here.

File details

Details for the file uwuzu_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: uwuzu_py-0.1.1-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

Hashes for uwuzu_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd1e4051859ca64a16a09c55f78930d724c7f6ff871b0a23418eb8bb7e9f648
MD5 a535f10faea44ad971578ed705be44e5
BLAKE2b-256 671745191a9dbe4e3501e19006128972aa7f157585238d00751d429c2df01290

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