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. Mini Apps, HTML parse modes, grouped-media edits, external Telegram conformance and interactive Android mode 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.0a1.tar.gz (139.2 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.0a1-py3-none-any.whl (155.6 kB view details)

Uploaded Python 3

File details

Details for the file gramlab-0.1.0a1.tar.gz.

File metadata

  • Download URL: gramlab-0.1.0a1.tar.gz
  • Upload date:
  • Size: 139.2 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.0a1.tar.gz
Algorithm Hash digest
SHA256 af820fee1fbb3245c25509d2aa43e99fd79b7982fb3c91cdc5615e6f4d9820a5
MD5 040aa2174c42fa9831e7210c48fba93e
BLAKE2b-256 97668eba669945ba25355c2e85a91b9e983e9eaf398e3b89e6be337e26becca2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gramlab-0.1.0a1.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.0a1-py3-none-any.whl.

File metadata

  • Download URL: gramlab-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 155.6 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.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e32acdb008e5f511674b13d3a3359cb2dfc0c84a2d78aae6a9c56b09191d7fb
MD5 7fc212c8ba51ef1ec45b337d74ef7d67
BLAKE2b-256 4cfc1b62fc721635e7eb2fc60a9e9b18cc868801754627eaabd52a6cff6a3de8

See more details on using hashes here.

Provenance

The following attestation bundles were made for gramlab-0.1.0a1-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.0a1 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