Skip to main content
vekgram

vekgram

PyPI Python Downloads License

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

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.

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, 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, 1 MiB parts for big uploads, 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).

Example with Inline Keyboard

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

pip install vekgram

Or in requirements.txt:

vekgram[fast]

Requires Python 3.10+. vekgram[fast] additionally pulls in 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:

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

# 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

Resources

Metadata

Release files for vekgram 3.2.2

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

Source distribution (sdist)

Source distribution for vekgram 3.2.2
File Size Uploaded Provenance Actions
vekgram-3.2.2.tar.gz 1.0 MB Without provenance Details for vekgram-3.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 7.9 MB

Release files / vekgram-3.2.2.tar.gz

Download URL vekgram-3.2.2.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
cc604b4eeb69ad9eef228a52a53db38cd461091a21fcc7bc69f5a481302be5b3
BLAKE2b-256 checksum
How to use checksums
034ba6802e9e16ef38b20486214c03768183bb2556a8ca830175e9f32ced27a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / vekgram-3.2.2-py3-none-any.whl

Download URL vekgram-3.2.2-py3-none-any.whl
Size 6.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
00dc3e2865c38acb9d78aa4b01b066335abd56e0051861207870cd2586f4be2b
BLAKE2b-256 checksum
How to use checksums
05c54ca8ea7b5012ef51fc8dfef81e43ece1661fccca63dcd664987878c2a293
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for vekgram 3.2.2

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