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.

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 published with PyPI Trusted Publishing (OIDC) — no API token is stored anywhere. .github/workflows/publish.yml runs when a GitHub release is published, with permissions: id-token: write in the vekgram environment, and uv publish exchanges the OIDC token automatically. The trusted publisher on PyPI is registered for this repository (yuIlariy/vekgram), workflow publish.yml. To release: create a GitHub release (e.g. v3.1.7); the first run activates the pending publisher and uploads vekgram to PyPI.

Credits

  • Pyrogram by Dan — the original MTProto framework.
  • wzgram by rjriajul — the base of this fork, including WarpCrypto, the Rust crypto backend.
  • vekgram by yuIlariy.

Resources

Metadata

Release files for vekgram 3.1.7

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.1.7
File Size Uploaded Provenance Actions
vekgram-3.1.7.tar.gz 1.1 MB Without provenance Details for vekgram-3.1.7.tar.gz

Built distribution (wheel)

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

Total release size: 7.9 MB

Release files / vekgram-3.1.7.tar.gz

Download URL vekgram-3.1.7.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c28b4a80112eeca440cca60d0b2654277ed65e8691cbb85e254f91e4b524be4b
BLAKE2b-256 checksum
How to use checksums
4446f442f90324e19cb4a833395430074f26b76ea645808bcb8e6163461d464b
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.1.7-py3-none-any.whl

Download URL vekgram-3.1.7-py3-none-any.whl
Size 6.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
74a863789b3699ad1162d423a17ce113b7c93873051472d91af7bbe7a0ab0d3d
BLAKE2b-256 checksum
How to use checksums
abca6289625d35a84894f1c3acc90a748d8fdc904904f2d4727f910a060205cb
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.1.7

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