Skip to main content
PyJetra Logo

PyJetra

A modern, bilingual (Sync & Async) Python wrapper for the Jetra Bot API

PyPI Python License Jetra


🌐 English

🚀 What is PyJetra?

PyJetra is the first and most complete Python library for building Jetra bots. It provides a clean, modern interface over the Jetra Bot API with full support for both synchronous and asynchronous workflows.

Whether you're building a small personal bot or a large group-management system, PyJetra gives you all the tools you need — without hiding the details.

✨ Features

  • 🔄 Sync & Async — JetraBot (requests) and AsyncJetraBot (aiohttp)
  • 🎛️ Full Bot API coverage — messages, media, edits, deletes, callbacks, webhooks
  • 🧠 FSM state management — set_state, get_state, clear_state
  • 🎨 Inline keyboards — multi-level menus, URL buttons, callbacks
  • 🧩 Advanced filters — CommandFilter, TextFilter, RegexFilter
  • 📨 Edited message events — @bot.on_edited_message decorator
  • 📎 Full media support — photo, document, video, audio, voice, sticker, animation, location, contact, venue
  • 🌐 Webhook ready — set_webhook, delete_webhook, get_webhook_info
  • 💬 Rich Message type — parses reply_to_message, forwards, service events
  • 🐍 Pythonic — type hints, clean dataclasses, no boilerplate

📦 Installation

pip install pyjetra

⚡ Quick Start

from pyjetra import JetraBot, CommandFilter, InlineKeyboardMarkup, InlineKeyboardButton

bot = JetraBot("YOUR_BOT_TOKEN")

@bot.on_message(filters=[CommandFilter("start")])
def start(msg):
    keyboard = InlineKeyboardMarkup([
        [InlineKeyboardButton(text="Open Jetra", url="https://jetra.ir")],
        [InlineKeyboardButton(text="About", callback_data="about")],
    ])
    msg.reply("Welcome to PyJetra!", reply_markup=keyboard)

@bot.on_callback_query()
def on_button(cb):
    if cb.data == "about":
        cb.answer("PyJetra v1.4.0 — Modern Python wrapper for Jetra Bot API")

bot.poll()

🧠 FSM Example

@bot.on_message(filters=[CommandFilter("register")])
def register(msg):
    bot.set_state(msg.from_user.id, "waiting_for_name")
    msg.reply("What's your name?")

@bot.on_message()
def handle_name(msg):
    if bot.get_state(msg.from_user.id) == "waiting_for_name":
        bot.clear_state(msg.from_user.id)
        msg.reply(f"Nice to meet you, {msg.text}!")

📚 Documentation

· 📦 PyPI: pypi.org/project/pyjetra · 📁 GitHub: github.com/lyrdaadhrpyk802-ux/pyjetra · 🧪 Examples: see the tests/ folder for working scripts


🌐 فارسی

🚀 PyJetra چیه؟

PyJetra اولین و کامل‌ترین کتابخانه‌ی پایتون برای ساخت ربات‌های جترا هست. یه رابط تمیز و مدرن روی Bot API جترا فراهم می‌کنه، با پشتیبانی کامل از هر دو حالت همگام (Sync) و ناهمگام (Async).

چه یه ربات شخصی کوچیک بسازی، چه یه سیستم مدیریت گروه بزرگ، PyJetra همه‌ی ابزارهای لازم رو در اختیارت می‌ذاره.

✨ امکانات

· 🔄 همگام و ناهمگام — JetraBot (requests) و AsyncJetraBot (aiohttp) · 🎛️ پوشش کامل Bot API — پیام، رسانه، ویرایش، حذف، کلیک‌ها، وب‌هوک · 🧠 مدیریت وضعیت (FSM) — set_state, get_state, clear_state · 🎨 دکمه‌های شیشه‌ای — منوهای چندسطحی، دکمه‌های URL، کال‌بک · 🧩 فیلترهای پیشرفته — CommandFilter, TextFilter, RegexFilter · 📨 رویداد ویرایش پیام — دکوراتور @bot.on_edited_message · 📎 پشتیبانی کامل رسانه — عکس، فایل، ویدیو، صدا، ویس، استیکر، انیمیشن، موقعیت، مخاطب، مکان · 🌐 آماده‌ی Webhook — set_webhook, delete_webhook, get_webhook_info · 💬 تایپ کامل Message — پارس reply_to_message، فوروارد، رویدادهای سرویس · 🐍 پایتونیک — type hint، dataclass تمیز، بدون boilerplate

📦 نصب

pip install pyjetra

⚡ شروع سریع

from pyjetra import JetraBot, CommandFilter

bot = JetraBot("YOUR_BOT_TOKEN")

@bot.on_message(filters=[CommandFilter("start")])
def start(msg):
    msg.reply("سلام از PyJetra!")

bot.poll()

🧠 مثال FSM

@bot.on_message(filters=[CommandFilter("register")])
def register(msg):
    bot.set_state(msg.from_user.id, "waiting_for_name")
    msg.reply("اسمت چیه؟")

@bot.on_message()
def handle_name(msg):
    if bot.get_state(msg.from_user.id) == "waiting_for_name":
        bot.clear_state(msg.from_user.id)
        msg.reply(f"خوشبختم، {msg.text}!")

📚 مستندات

· 📦 PyPI: pypi.org/project/pyjetra · 📁 GitHub: github.com/lyrdaadhrpyk802-ux/pyjetra · 🧪 مثال‌ها: پوشه‌ی tests/ رو ببین


👤 About the Developer

Ali VEX

Founder & Lead Developer of PyJetra Bot Developer • Python Enthusiast • Jetra Community Member

🧭 Bio

Ali VEX is a passionate Python developer who created PyJetra — the first and most complete Python library for the Jetra Bot API. He is active in the Jetra developer community and maintains JetraGuard, a full-featured group-management bot built on top of PyJetra as a real-world showcase.

His goal: make Jetra bot development accessible, clean, and fun for every developer — from beginners to professionals.

📬 Connect with Ali VEX

Platform Link 💬 Jetra Profile @UserBoT 📢 PyJetra Channel @pyJetra 👥 JetraGuard Community @Chatpyjetra 🐙 GitHub lyrdaadhrpyk802-ux 📧 Email lyrdaadhrpyk802@gmail.com 📦 PyPI pypi.org/project/pyjetra


💬 Community & Support

Got questions, ideas, or want to share what you built with PyJetra? Join the community on Jetra:

· 📢 Channel — jetra.ir/pyJetra — release notes, updates, tutorials · 👥 Chat Group — jetra.ir/Chatpyjetra — ask questions, report bugs, share bots · 🐛 Issues — github.com/lyrdaadhrpyk802-ux/pyjetra/issues

Every bit of feedback helps shape the next version of PyJetra. ❤️


📜 License

This project is licensed under the MIT License — see the LICENSE file for details.


Made with ❤️ for the Jetra community

ساخته‌شده با ❤️ برای جامعه‌ی جترا

Metadata

Release files for pyjetra 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyjetra 1.5.0
File Size Uploaded Provenance
pyjetra-1.5.0.tar.gz 16.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyjetra 1.5.0
File Interpreter ABI Platform
pyjetra-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.7 kB

Release files / pyjetra-1.5.0.tar.gz

Download URL pyjetra-1.5.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
73776ec020e01f1256e6a1e0ab07361ac77cc393be84d74eaec2ece3009ecf0b
BLAKE2b-256 checksum
How to use checksums
30bcace3254b0abbddffb22e4f8fc8beee95cc745e6f529137a617d142c54fd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / pyjetra-1.5.0-py3-none-any.whl

Download URL pyjetra-1.5.0-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8439f3de2fd138a36d6589143a5c16f69527ea3caf52a3715b3e32e5edf32688
BLAKE2b-256 checksum
How to use checksums
1935f35a9b910858865dcf68ebcb413f15dac660a20c14bd3bcb4db6695cbd85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for pyjetra 1.5.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page