Metadata-Version: 2.5
Name: vekgram
Version: 3.3.0
Summary: Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
Project-URL: Homepage, https://github.com/yuIlariy/vekgram
Project-URL: Documentation, https://vekgram.com
Project-URL: Source, https://github.com/yuIlariy/vekgram
Project-URL: Issues, https://github.com/yuIlariy/vekgram/issues
Author-email: Dan <dan@pyrogram.org>
Maintainer: yuIlariy
License-Expression: LGPL-3.0-or-later
License-File: COPYING
License-File: COPYING.lesser
Keywords: api,chat,client,library,messenger,mtproto,python,telegram
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable
Classifier: Programming Language :: Python :: Implementation
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Communications
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: python-socks[asyncio]>=2.4.0
Requires-Dist: warpcrypto>=2.0.8
Provides-Extra: botapi
Requires-Dist: beautifulsoup4>=4.12; extra == 'botapi'
Requires-Dist: html5lib>=1.1; extra == 'botapi'
Requires-Dist: requests>=2.32; extra == 'botapi'
Provides-Extra: dev
Requires-Dist: jinja2>=3; extra == 'dev'
Requires-Dist: poethepoet>=0.32; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: pyyaml>=6; extra == 'dev'
Requires-Dist: twine>=5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: furo>=2023; extra == 'docs'
Requires-Dist: sphinx-copybutton>=0.5; extra == 'docs'
Requires-Dist: sphinx>=7; extra == 'docs'
Provides-Extra: fast
Requires-Dist: uvloop<=0.23.0; ((sys_platform == 'darwin' or sys_platform == 'linux') and platform_python_implementation == 'CPython') and extra == 'fast'
Provides-Extra: mongo
Requires-Dist: motor>=3.5; extra == 'mongo'
Provides-Extra: redis
Requires-Dist: redis>=5.0; extra == 'redis'
Description-Content-Type: text/markdown

<div align="center">

<img src="https://raw.githubusercontent.com/yuIlariy/vekgram/vek/assets/png/vekgram-icon-256.png" alt="vekgram" width="160">

# vekgram

[![PyPI](https://img.shields.io/pypi/v/vekgram)](https://pypi.org/project/vekgram/)
[![Python](https://img.shields.io/pypi/pyversions/vekgram)](https://pypi.org/project/vekgram/)
[![Downloads](https://img.shields.io/pypi/dm/vekgram)](https://pypi.org/project/vekgram/)
[![License](https://img.shields.io/github/license/yuIlariy/vekgram)](https://github.com/yuIlariy/vekgram/blob/vek/COPYING.lesser)

**Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots**

</div>

vekgram is a **drop-in replacement** for Pyrogram, with access to the latest Telegram features including **Gifts, Stories, Topics, Business Accounts**, and more. Import `vekgram`; `from pyrogram import ...` still resolves to the same module rather than a second copy of it, so an existing Pyrogram codebase runs unchanged.

```python
from vekgram import Client, filters

app = Client("my_account")


@app.on_message(filters.private)
async def hello(client, message):
    await message.reply("Hello from vekgram!")


app.run()
```

`from pyrogram import Client, filters` works too — both names are one module: `vekgram.types.Message is pyrogram.types.Message`.

### Key Features

- **Drop-in Replacement** — New code says `from vekgram import ...`; existing `from pyrogram import ...` codebases migrate with zero changes, since both names are one module.
- **Up-to-Date** — Supports Gifts, Stories, Topics, Business Accounts, Giveaways, and the latest Telegram layer.
- **Async Natively** — Fully `async`/`await` throughout. Also usable synchronously via `app.run()` for convenience.
- **Type-hinted** — Every type and method is annotated for excellent editor support.
- **Fast** — Boosted by [WarpCrypto](https://github.com/rjriajul/WarpCrypto), a high-performance cryptography library written in Rust. `warpcrypto` is a core dependency, so it is always installed with vekgram.
- **Powerful** — Full access to Telegram's API for any official client action and more.
- **Tuned for bots that move files** — priority download queue (small files jump ahead), split upload/download concurrency budgets, staggered flood-wait retries, slower keepalives on media sessions, and a default rate limiter for bots. All tunable via `VEKGRAM_*` environment variables (see [performance docs](https://yuilariy.github.io/vekgram/features/performance/)).

### Example with Inline Keyboard

```python
from vekgram import Client, filters
from vekgram.types import InlineKeyboardMarkup, InlineKeyboardButton

app = Client("my_bot")


@app.on_message(filters.command("start"))
async def start(client, message):
    await message.reply(
        "Choose an option:",
        reply_markup=InlineKeyboardMarkup([
            [
                InlineKeyboardButton("Website", url="https://example.com"),
                InlineKeyboardButton("Help", callback_data="help"),
            ],
            [InlineKeyboardButton("About", callback_data="about")],
        ])
    )


app.run()
```

### Installing

```bash
pip install vekgram
```

Or in `requirements.txt`:

```text
vekgram[fast]
```

Requires Python 3.10+. `vekgram[fast]` additionally pulls in [uvloop](https://github.com/MagicStack/uvloop) on Linux and macOS (CPython); call `uvloop.install()` yourself to use it (see the Speedups guide). Because `warpcrypto` is a core dependency, `vekgram[fast]` automatically installs **both uvloop and warpcrypto** — the same way `wzgram[fast]` did:

```bash
pip install "vekgram[fast]"
```

Do not install `pyrogram` and `vekgram` side by side: they provide the same `pyrogram` module and whichever was installed last wins. Run `pip uninstall pyrogram` first if it is already there.

### Development

```bash
# Clone the repo
git clone https://github.com/yuIlariy/vekgram.git
cd vekgram

# Install uv (if not already)
pip install uv

# Create virtual environment with dev dependencies
uv sync --frozen --extra dev

# Generate TL API types
uv run poe api

# Run tests
uv run poe test
```

### Publishing to PyPI

Releases are fully automatic and published with **PyPI Trusted Publishing (OIDC)** — no API token is stored anywhere. Push a version tag (`git tag v3.1.8 && git push origin v3.1.8`) and `.github/workflows/publish.yml` builds the package, runs `uv publish dist/*` (the `id-token: write` permission in the `vekgram` environment lets uv exchange the OIDC token automatically), and creates the GitHub release with the `dist/` assets. The trusted publisher on PyPI is registered for this repository (`yuIlariy/vekgram`), workflow `publish.yml`, environment `vekgram`, any ref. `pip install vekgram` always comes from **PyPI**, not from GitHub releases. One-click release: **Actions → Release → Run workflow** (`.github/workflows/release.yml` bumps `__version__` in `pyrogram/__init__.py`, commits, tags and pushes — which triggers the publish).

### Credits

- [Pyrogram](https://github.com/pyrogram/pyrogram) by **Dan** — the original MTProto framework.
- [wzgram](https://github.com/rjriajul/wzgram) by **rjriajul** — the base of this fork, including [WarpCrypto](https://github.com/rjriajul/WarpCrypto), the Rust crypto backend.
- **vekgram** by [yuIlariy](https://t.me/xspes) ([GitHub](https://github.com/yuIlariy)).

### Resources

- [Source code](https://github.com/yuIlariy/vekgram)
- [Issue tracker](https://github.com/yuIlariy/vekgram/issues)
- [Contributing guide](https://github.com/yuIlariy/vekgram/blob/vek/CONTRIBUTING.md)
- [Telegram channel](https://t.me/vekgram) — news, releases, announcements
- [Telegram group](https://t.me/vekgramchat) — questions and discussion
- [Maintainer on Telegram](https://t.me/xspes)
