How darkyamagai/pymino works
Project type and purpose
• This is an open-source Python library (“pymino”) that wraps the Amino Apps HTTP/WebSocket API.
• It exposes two main entry points:
• Client – a low-level API client for HTTP calls and community operations.
• Bot – a higher-level, event-driven framework with commands, tasks, and event listeners.
File structure
• Top-level package “pymino/”:
• bot.py – defines the Bot class, event decorators, command/task registration, and run loop.
• client.py – defines the Client class, login, community management, and raw API calls.
• “pymino/ext/” – extension modules and core sub-components:
• account.py, community.py, console.py, context.py – provide layered APIs and context objects.
• dispatcher.py – event dispatching and listener registry (observer pattern).
• global_client.py, handle_queue.py – shared network client and async event queue.
• socket.py – WebSocket connection handler for real-time events.
• “pymino/ext/entities/” – data models reflecting API responses (Messages, Threads, Users, etc.).
• “pymino/ext/utilities/” – helpers for request handling, console UIs, command parsing, code generation.
• Configuration/build files: setup.py, pyproject.toml, requirements.txt.
Insights from README
• The library uses both HTTP (Client) and WebSocket (Bot) to communicate with Amino Apps.
• Bot features include event callbacks (@bot.on_text_message, @bot.command, @bot.task), and an optional console.
• Entities are passed into user callbacks (Context, Member, Message, etc.).
• It supports proxies and custom device IDs.