Tdjson
High-performance Python binding for TDLib JSON interface
Install / Use
/learn @AYMENJD/TdjsonREADME
tdjson

tdjson is a high-performance Python binding for TDLib JSON interface.
By bundling pre-built TDLib binaries, it eliminates the effort for manual compilation and offers performance advantage over traditional ctypes wrappers, making it a reliable core for projects like Pytdbot
Compatibility
tdjson is compatible with the following platforms:
-
Linux (
x64andARM64) — Debian 8+, Ubuntu 13.10+, Fedora 19+, RHEL 7+ -
Windows (
x64) — Windows 7+ -
macOS (
M-series) — macOS 11+
Installation
You can install tdjson directly from PyPI:
pip install tdjson
Usage
Here’s a quick example to get you started:
import json
import tdjson
# Create a new TDLib client
client_id = tdjson.td_create_client_id()
# Send a request to TDLib
request = {"@type": "getOption", "name": "version"}
tdjson.td_send(client_id, json.dumps(request).encode("utf-8"))
# Receive updates or responses
response = tdjson.td_receive(10.0)
print(response)
# Synchronously execute a TDLib request
result = tdjson.td_execute(
json.dumps(
{
"@type": "getTextEntities",
"text": "@telegram /test_command https://telegram.org telegram.me",
"@extra": ["5", 7.0, "a"],
}
).encode("utf-8")
)
print(result)
For more detailed examples, check out the examples folder.
License
MIT LICENSE
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
84.6kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
341.8kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
