⚡ RubiFlow (روبیفلو)
فریمورک فوقسریع، ناهمگام (Async) و مدرن پایتون برای پیامرسان و سوپراپ روبیکا
Next-Generation High-Performance Async Python Framework for Rubika Messenger & SuperApp
🌟 چرا RubiFlow؟
- نام کاملاً اختصاصی و جدید: نامی تک و ثبتنشده در PyPI که به جریان روان، غیرهمزمان و پرسرعت اشاره دارد.
- Async-First و با بالاترین بازده: با موتور شبکه
aiohttp، مدیریت Connection Pooling و رمزنگاری با توابع C درcryptography. - رعایت کامل استانداردهای PEP 8 و Clean Architecture: استفاده دقیق از Type Hints، مدلهای دادهای (
dataclasses) و مدیریت خطا با استثناهای اختصاصی. - شناسایی خودکار سشن فایرفاکس: توانایی اتصال آنی به حساب فعال در فایرفاکس (بدون نیاز به دریافت کد پیامکی مجدد).
- پشتیبانی از StringSession: خروجی سشن به صورت یک رشته متنی فشرده و امن با پیشوند
RubiFlow$...جهت استقرار روی سرورها. - پوشش جامع بیش از ۳۰۰ متد: پشتیبانی از پیامرسان کامل، روبینو (Rubino)، فیلم و سریال (VOD) و کیف پول.
- توابع کمکی و شیگرایی پیشرفته: ارسال آسان پیام، ریپلای مستقیم با
message.reply("...")، حذف و ویرایش، دریافت چتها و پیامها.
📦 نصب
pip install -e .
یا پیشنیازها:
pip install aiohttp cryptography
🚀 شروع سریع (Quickstart)
۱. اتصال خودکار از طریق سشن فایرفاکس
import asyncio
from rubiflow import Client
async def main():
# اتصال مستقیم به سشن مرورگر فایرفاکس شما
app = Client.from_firefox()
async with app:
me = await app.get_me()
print(f"Logged in as: {me.full_name} (@{me.username})")
# ارسال پیام
msg = await app.send_message("u0...", "سلام از روبیفلو!")
print(f"پیام ارسال شد با آیدی: {msg.message_id}")
asyncio.run(main())
۲. ساخت بات پاسخگوی خودکار (Event-Driven Echo Bot)
from rubiflow import Client, Message
app = Client.from_firefox()
@app.on_message()
async def handle_message(msg: Message):
if msg.text == "سلام":
await msg.reply("درود! پیام شما توسط بات RubiFlow دریافت شد.")
# اجرای مداوم بات
app.run()
۳. استفاده از رشته سشن (StringSession) برای سرور
import asyncio
from rubiflow import Client
async def export_session():
app = Client.from_firefox()
async with app:
# دریافت رشته امن برای قرار دادن روی سرور یا متغیرهای محیطی
string_session = app.session.to_string()
print("Your StringSession:", string_session)
# بازیابی مجدد سشن
new_app = Client(session=string_session)
async with new_app:
me = await new_app.get_me()
print("Connected with StringSession as:", me.username)
asyncio.run(export_session())
📂 ساختار ماژولار پروژه
rubika-lib/
├── pyproject.toml # پیکربندی استاندارد بسته پایتون
├── README.md # راهنمای کامل
├── rubiflow/
│ ├── __init__.py # اکسپورت کلاسها و توابع اصلی
│ ├── client.py # هسته کلاینت و متدهای سطح بالا
│ ├── crypto.py # موتور پرسرعت رمزنگاری روبیکا V6 (AES-256 + RSA-SHA256)
│ ├── session.py # مدیریت سشن (Firefox, StringSession, FileSession)
│ ├── network.py # ارتباطات ناهمگام با Connection Pooling
│ ├── exceptions.py # استثناهای اختصاصی (InvalidAuthError, ApiError, ...)
│ └── models/
│ ├── user.py # کلاس داده کاربر (User)
│ ├── chat.py # کلاس داده گفتگو (Chat)
│ └── message.py # کلاس داده پیام همراه متدهای reply, delete, edit
├── docs/
│ ├── RUBIKA_API_FULL_REFERENCE.md # کاتالوگ جامع بیش از ۳۰۰ متد روبیکا
│ └── RUBIKA_CRYPTO_AND_PROTOCOL.md # جزئیات مهندسی معکوس و رمزنگاری
└── examples/
└── rubiflow_quickstart.py # نمونه کد تست زنده و جامع
🛡️ لایسنس
توسعه داده شده تحت لایسنس MIT.
Metadata
Release files for rubiflow 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rubiflow-1.0.0.tar.gz | 27.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rubiflow-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.5 kB
Release files / rubiflow-1.0.0.tar.gz
| Download URL | rubiflow-1.0.0.tar.gz |
|---|---|
| Size | 27.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1189385ec42f5190de480bcc400fed60a22e5caa7c389062e7d32d77707f8287
|
|
BLAKE2b-256 checksum How to use checksums |
4f2f5c5fe7ab0849ac2736b8fcca2049eb518db23e336610caa5b21d805716bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / rubiflow-1.0.0-py3-none-any.whl
| Download URL | rubiflow-1.0.0-py3-none-any.whl |
|---|---|
| Size | 31.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a990308d55468398b6a35e6e3fc7726256832449aae74a16afec748f63d0631a
|
|
BLAKE2b-256 checksum How to use checksums |
061ba3ed521f9746d8ed728de409c9d88ac58a6117ffb51892c66cdd267ae5f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for rubiflow 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.