Skip to main content
Pre-release

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

GramLab

An English GramLab conversation in the Telegram Android renderer, with rich text, buttons and glass effects.

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

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

gramlab-0.1.0a2.tar.gz (155.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gramlab-0.1.0a2-py3-none-any.whl (172.9 kB view details)

Uploaded Python 3

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

Hashes for gramlab-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 38386ed312d7afaab48a766ed4c0ea66bab9235608326127327f932885260667
MD5 dc7e2fb4991855833dd5d21d8900cebe
BLAKE2b-256 7fb7d43faabd08fded3a8c8866ede114c3984d159267ab57ebbfce37b74df03b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gramlab-0.1.0a2.tar.gz:

Publisher: release.yml on tholoo/GramLab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gramlab-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 95ed078546bd3e15d1b44c616ef717d2bf6bb1f3aa9faeff4e52f9220b08d69a
MD5 f126276b498635a2acabcaef6249ad04
BLAKE2b-256 25992159b451b938d8d25980e7b0849a0c31c57832da92f336f09f2c5ca89dee

See more details on using hashes here.

Provenance

The following attestation bundles were made for gramlab-0.1.0a2-py3-none-any.whl:

Publisher: release.yml on tholoo/GramLab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0a2 This release

2 files

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