This release is a pre-release and may not be stable for production use.
GramLab
Original Android capture, with glass effects enabled.
Test Telegram bots locally and inspect their messages in the actual Telegram Android client. No Telegram account or production token is needed.
Experimental. Text, callbacks, rich messages, photos, documents, albums and custom emoji have tested original-Android workflows. A persistent playground supports seeded state, a visible and clickable original Android client, messages, rich-button input, bot addition and reset. Mini Apps, HTML parse modes, grouped-media edits, external Telegram conformance and native Telegram membership administration remain unfinished. See the compatibility matrix for the supported scope.
Install
GramLab currently requires Python 3.13 on a supported Linux host. Install the experimental prerelease explicitly:
uv add "gramlab==0.1.0a1"
The package includes the gramlab command and typed Python scenario interface. Android captures
require separately prepared local tooling and are not distributed in the Python package.
Write a scenario
Create a user, talk to a real local bot, check its reply and capture the conversation:
from gramlab import Scenario
lab = Scenario.from_environment()
chat = lab.conversation(user=lab.user("Alex", language_code="en"), bot="echo")
chat.send("Hello!")
history = chat.wait_for_messages(2, timeout=5)
if history[1].text != "Echo: Hello!":
raise AssertionError("Unexpected bot reply")
chat.capture("hello", contains=["Echo: Hello!"])
This runs inside a scenario process. The
English echo example uses
this exact scenario,
with the bundled bot and manifest, and the runner supplies the environment. Simulation records the conversation state;
headless Android also captures the original client. Both modes produce a local HTML report.
The typed handles are additive: advanced scenarios can still use the raw JSON-shaped operations
on Scenario. The Python interface is still experimental.
Try it
Start with the development environment. On a supported Linux host with Nix and user namespaces:
nix develop
uv sync --locked
mkdir -p artifacts
uv run --locked --offline gramlab run examples/echo/hello.toml --output artifacts/echo-demo
Open artifacts/echo-demo/report.html. Use a new output directory for each run.
The runner isolates bot and scenario processes; dependency setup happens before execution.
Android captures require the separate
Android setup.
More examples: button presses, rich messages, rich buttons, and bot restart.
Work on GramLab
- Contributor setup and checks
- Current handoff and remaining work
- Architecture and product scope
- Offline execution rules
- Working in parallel
- Release history
Original core and SDK code uses MIT. Two TDLib-derived Python modules retain BSL-1.0. Android-derived patches and fixtures retain GPL-2.0-or-later. See the license map and licensing boundaries. This is a source repository. No Android APK release or completed dependency license audit is offered.
GramLab is unofficial and is not affiliated with or endorsed by Telegram.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gramlab-0.1.0a2.tar.gz.
File metadata
- Download URL: gramlab-0.1.0a2.tar.gz
- Upload date:
- Size: 155.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38386ed312d7afaab48a766ed4c0ea66bab9235608326127327f932885260667
|
|
| MD5 |
dc7e2fb4991855833dd5d21d8900cebe
|
|
| BLAKE2b-256 |
7fb7d43faabd08fded3a8c8866ede114c3984d159267ab57ebbfce37b74df03b
|
Provenance
The following attestation bundles were made for gramlab-0.1.0a2.tar.gz:
Publisher:
release.yml on tholoo/GramLab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gramlab-0.1.0a2.tar.gz -
Subject digest:
38386ed312d7afaab48a766ed4c0ea66bab9235608326127327f932885260667 - Sigstore transparency entry: 2831060642
- Sigstore integration time:
-
Permalink:
tholoo/GramLab@20d631872ae41821d06ee2b19e48ccb7d1db9172 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/tholoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@20d631872ae41821d06ee2b19e48ccb7d1db9172 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gramlab-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: gramlab-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 172.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ed078546bd3e15d1b44c616ef717d2bf6bb1f3aa9faeff4e52f9220b08d69a
|
|
| MD5 |
f126276b498635a2acabcaef6249ad04
|
|
| BLAKE2b-256 |
25992159b451b938d8d25980e7b0849a0c31c57832da92f336f09f2c5ca89dee
|
Provenance
The following attestation bundles were made for gramlab-0.1.0a2-py3-none-any.whl:
Publisher:
release.yml on tholoo/GramLab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gramlab-0.1.0a2-py3-none-any.whl -
Subject digest:
95ed078546bd3e15d1b44c616ef717d2bf6bb1f3aa9faeff4e52f9220b08d69a - Sigstore transparency entry: 2831060547
- Sigstore integration time:
-
Permalink:
tholoo/GramLab@20d631872ae41821d06ee2b19e48ccb7d1db9172 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/tholoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@20d631872ae41821d06ee2b19e48ccb7d1db9172 -
Trigger Event:
push
-
Statement type: