Skip to Content
Getting startedInstallation

Installation

Pick a language in the tabs or in the navbar; every tab on the site follows the choice.

Install
pip install opentele2

Python 3.8+ · abi3 wheels · works over Telethon

Requirements

PythonNodeRust
RuntimePython 3.8 or newer (CPython)Node 18 or newerRust 1.89 or newer, edition 2024
Packageopentele2 on PyPIopentele2 on npmopentele2-core, opentele2-browser, opentele2-versions, opentele2-grammers
Binaryabi3 wheels (one wheel per platform for every Python from 3.8) and free-threaded 3.14 wheels, for manylinux, musllinux, Windows and macOSa prebuilt Node-API addon for Windows, macOS and Linux (glibc and musl), x64 and arm64built from source by Cargo
Dependenciestelethon 1.45 or newer; typing_extensions below Python 3.10none; @mtcute/node 0.32+ as an optional peergrammers 0.11 crates for opentele2-grammers
Client libraryTelethonmtcutegrammers

Install

terminal
pip install opentele2

The wheel pulls in Telethon. Nothing else is needed: the tdata reader, the device catalogs, the browser networks and the crypto are inside the wheel.

Rust crate features

CrateFeatureDefaultWhat it adds
opentele2-coreparallelonbatch loads many folders on a dedicated rayon pool; results are identical without it
opentele2-coretelethon-sqliteoffTelethon .session files over a bundled SQLite; off so the default core links no C code
opentele2-grammersclientoffQR login with 2FA, session admin, consistency checks and tdata from a client, over grammers-client

opentele2-versions uses blocking HTTP (ureq with rustls) and needs no async runtime. opentele2-core never depends on grammers; opentele2-grammers is the bridge.

The Telethon crypto bridge

Important:

Import opentele2 before telethon. Telethon binds its AES-IGE implementation the first time telethon.crypto.aes is imported, so opentele2 must register its core-backed cryptg first.

import opentele2 registers the core’s AES-IGE as the top-level cryptg module when no real cryptg is installed (an installed cryptg stays in charge), and rebinds Telethon’s AES-CTR, PQ factorisation, SHA-1, SHA-256 and password hashing to the core. The rebinding works whichever of the two was imported first; only the cryptg registration depends on the order.

main.py
import opentele2 # first: registers the core's cryptg import telethon

See MTProto crypto core for what runs on the core.

Offline imports

Importing the Python package fetches the current official client versions once per process. Set OPENTELE_NO_FETCH to skip the fetch and use the built-in versions:

terminal
OPENTELE_NO_FETCH=1 python main.py

Node and Rust never fetch on import: fetchVersions() and opentele2_versions::fetch_all run only when called. See Client versions.

Check the install

Each snippet prints the TL schema layer opentele2 advertises, 230.

check.py
from opentele2.fingerprint import LAYER print(LAYER)

Next: Quick start.

Last updated on