Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ferogram-py

PyPI Python Downloads License Telegram

A modern, elegant, asynchronous MTProto framework for building Telegram clients and bots in Python.

Powered by a high-performance Rust core that takes care of networking, encryption, TL parsing, and session management so you can focus on writing clean, idiomatic Python.


Why ferogram-py?

Most of the heavy lifting in an MTProto client happens behind the scenes; networking, encryption, TL parsing, and keeping up with updates. ferogram-py lets a Rust core handle all of that, while exposing a clean, Pythonic API.

For most applications, the high-level API is all you'll need. But if you want to use a brand-new Telegram feature or need something more advanced, you can always drop down to the raw MTProto API and invoke requests directly.

The goal is to stay out of your way: simple things should be simple, and advanced things should still be possible.

Quick API reference: FEATURES.md


Install

pip install ferogram
Building from source
make dev      # editable install into .venv (builds the Rust extension)
make build    # release wheel for this machine
make codegen  # regenerate TL code without a Rust rebuild
make test     # run tests
make clean    # wipe .venv, target, dist, generated/

On Termux: pkg install rust clang python first. Rust-only change, don't want to wait on codegen: FEROGRAM_SKIP_CODEGEN=1 maturin develop


Quick start

Bot:

from ferogram import Client, filters

app = Client("mybot", api_id=0, api_hash="", bot_token="123:TOKEN")

@app.on_message(filters.command("start"))
async def start(client, message):
    await message.reply("Hello!")

app.run()

User:

import asyncio
from ferogram import Client

app = Client("myaccount", api_id=0, api_hash="", phone="+1234567890")

async def main():
    async with app as client:
        await client.send_message("me", "logged in")

asyncio.run(main())

Credentials also work from env vars: API_ID, API_HASH, BOT_TOKEN.

Logging

import ferogram.logging as fero_log

fero_log.setup()           # INFO to stderr
fero_log.setup(level=10)   # DEBUG

Architecture

architecture

The compiled extension (_ferogram.so) stays deliberately small: networking, encryption, session storage, and MTProto internals live in Rust. Everything you touch day to day, the client, handlers, filters, is plain Python and can change without a recompile.

Prebuilt Wheels for your platform

Wheels ship prebuilt for Linux (x86_64, aarch64), macOS (x86_64, arm64), Windows (x86_64), and Android/Termux (aarch64, x86_64). pip install ferogram grabs the right one on its own.


License

This project is dual-licensed under:

  • MIT License
  • Apache License 2.0

You may choose either license.

You are free to use, modify, and distribute this software, including for commercial use, provided the original license and copyright notice are included.

See LICENSE-MIT and LICENSE-APACHE for full details.


Developer

Developed by Ankit Chaubey

Don't forget to explore the Rust engine powering ferogram-py: ferogram. Thanks for being part of the journey.

Join the ferogram community! Questions, discussions, bugs report and feedback are always welcome. As the project grows, we'll eventually split Python and Rust discussions into dedicated spaces.

Metadata

Release files for ferogram 0.5.5b1

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

Source distribution (sdist)

Source distribution for ferogram 0.5.5b1
File Size Uploaded Provenance Actions
ferogram-0.5.5b1.tar.gz 725.0 kB Without provenance Details for ferogram-0.5.5b1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ferogram 0.5.5b1
File Actions
ferogram-0.5.5b1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for ferogram-0.5.5b1-cp39-abi3-win_amd64.whl
ferogram-0.5.5b1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for ferogram-0.5.5b1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
ferogram-0.5.5b1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for ferogram-0.5.5b1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
ferogram-0.5.5b1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for ferogram-0.5.5b1-cp39-abi3-macosx_11_0_arm64.whl
ferogram-0.5.5b1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for ferogram-0.5.5b1-cp39-abi3-macosx_10_12_x86_64.whl
ferogram-0.5.5b1-cp39-abi3-android_24_x86_64.whl CPython 3.9 abi3 Android API level 24+ x86-64 Details for ferogram-0.5.5b1-cp39-abi3-android_24_x86_64.whl
ferogram-0.5.5b1-cp39-abi3-android_24_x86.whl CPython 3.9 abi3 Android API level 24+ x86-32 Details for ferogram-0.5.5b1-cp39-abi3-android_24_x86.whl
ferogram-0.5.5b1-cp39-abi3-android_24_armeabi_v7a.whl CPython 3.9 abi3 Android API level 24+ ARM EABI v7a Details for ferogram-0.5.5b1-cp39-abi3-android_24_armeabi_v7a.whl
ferogram-0.5.5b1-cp39-abi3-android_24_arm64_v8a.whl CPython 3.9 abi3 Android API level 24+ ARM64 v8a Details for ferogram-0.5.5b1-cp39-abi3-android_24_arm64_v8a.whl

Total release size: 33.9 MB

Release files / ferogram-0.5.5b1.tar.gz

Download URL ferogram-0.5.5b1.tar.gz
Size 725.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c3b2130efa03d25d19b53123a1462d128c027e39867513aac46bc06e66a86bd0
BLAKE2b-256 checksum
How to use checksums
a9b65286f37b69e1226515743d226a85fc707ece64ce39d0e55b506f1ec06e7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-win_amd64.whl

Download URL ferogram-0.5.5b1-cp39-abi3-win_amd64.whl
Size 4.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
40c352ef17a6ecc2b3184c3e0f67403b09d71994fdcdcfb4c38d3666e209acb4
BLAKE2b-256 checksum
How to use checksums
8a371d3581fd95e2cb75d905492b25c50fb77e07d368cb9da898023a32af5b89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ferogram-0.5.5b1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
1e68b33734ce866681b94c6c165a399d33c739e545d949294ea4173b56e9ddea
BLAKE2b-256 checksum
How to use checksums
8571abc4bcc94981a5e33133ee4b8eaa52fa0f1a38439905e2ce8b4dd9b0fd94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ferogram-0.5.5b1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
5ded18720e6a276f750f8d2f8766612aa87dd6f71a79817d43806f08cd709e55
BLAKE2b-256 checksum
How to use checksums
950c5e3de4fbfeac1ede3bfc6056aab83bf4ed8e553ec5cb0254f38cfae5cd7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-macosx_11_0_arm64.whl

Download URL ferogram-0.5.5b1-cp39-abi3-macosx_11_0_arm64.whl
Size 3.5 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
02945f255dbf406cb89002291a9a7d7b7509b231362ff5aa2694809dd32be684
BLAKE2b-256 checksum
How to use checksums
52396f3176c764ad62dfe0df9a5d60360e7ae26637949f32b910f45410332de1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL ferogram-0.5.5b1-cp39-abi3-macosx_10_12_x86_64.whl
Size 3.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
86373291354718927e90a4c6a5d82b92c0bc3cae09c79fda71c716600de10594
BLAKE2b-256 checksum
How to use checksums
5cc446a38f8ca08cb5a7f4aca21e935172e4f16ff3eabdb1691eb1b5ab080178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-android_24_x86_64.whl

Download URL ferogram-0.5.5b1-cp39-abi3-android_24_x86_64.whl
Size 3.8 MB
Tags Android API level 24+ x86-64 CPython 3.9 abi3
SHA-256 checksum
How to use checksums
8770821d3c54cec3986911ea993fa3b79105c59023e212da78ca803bf032ddbb
BLAKE2b-256 checksum
How to use checksums
110bc886140e09c10cade1666adcc13e280af04cea814f30fb62357a1bd10c63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-android_24_x86.whl

Download URL ferogram-0.5.5b1-cp39-abi3-android_24_x86.whl
Size 3.8 MB
Tags Android API level 24+ x86-32 CPython 3.9 abi3
SHA-256 checksum
How to use checksums
054081baca6f31df6a8623f5de44611b3347f0e95cdf95976827aea25477e0ff
BLAKE2b-256 checksum
How to use checksums
66c076e06fa73f815a5514304585444021a9727d4fce583caf41aebe295de521
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-android_24_armeabi_v7a.whl

Download URL ferogram-0.5.5b1-cp39-abi3-android_24_armeabi_v7a.whl
Size 3.5 MB
Tags Android API level 24+ ARM EABI v7a CPython 3.9 abi3
SHA-256 checksum
How to use checksums
606765cbeb1f0bd63255368b8253f67c561b7b62fe3779f0f39ac1dd33f50071
BLAKE2b-256 checksum
How to use checksums
dca23548c26b8b3db0c33e793f01eb2b360e6426831fd12391ec77a5601575dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Release files / ferogram-0.5.5b1-cp39-abi3-android_24_arm64_v8a.whl

Download URL ferogram-0.5.5b1-cp39-abi3-android_24_arm64_v8a.whl
Size 3.6 MB
Tags Android API level 24+ ARM64 v8a CPython 3.9 abi3
SHA-256 checksum
How to use checksums
d86863afbd960d7cfb69c282e2ec172f8d9814198d9e7bf67bf6075e0cdc4446
BLAKE2b-256 checksum
How to use checksums
caf869b27cfbde2c0f9d21283fd63ed619f18655e8e5417e2c0a913209d479fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Security for ferogram 0.5.5b1

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.

Release history Release notifications | RSS feed

This release
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