arrow_back Projects
PERSONAL // 2025 Duccio Meconcelli

Telewrapperz

Python PyPI Telegram Bot API GPU Monitoring Rich System Tools

Project Visualization

Telewrapperz

Visit Live Sitearrow_outward
auto_awesome Abstract

A Python command wrapper that updates a Telegram dashboard with recent output, resource information, and controls for a running command.

Overview

I built Telewrapperz after repeatedly leaving training scripts and other long-running commands on remote machines. Opening a new SSH session just to check the latest lines of output was unnecessary friction, especially when the useful information was simply whether the process was still running and how the hardware was behaving.

The package wraps a command and maintains one Telegram message as a compact live dashboard. It is published on PyPI as telewrapperz and can be used with regular shell commands, Python scripts, and machine-learning training jobs.

Monitoring and control

The dashboard shows the command, host, process status, elapsed time, recent output, CPU use, and RAM use. When NVIDIA hardware is available, Telewrapperz reports GPU utilization and memory through pynvml. The same message is updated at a configurable interval instead of sending a new notification for every line.

Inline controls allow the user to request an immediate refresh or terminate the wrapped process. Full output can also be written to a local log and downloaded from Telegram when logging is enabled. Completion and failure remain visible in the final dashboard state.

Terminal output is more complicated than a sequence of newline-terminated strings. Progress bars from tqdm or Rich often rewrite the current line, while some dashboards move the cursor across several lines. Telewrapperz keeps a bounded display buffer and interprets these updates so the Telegram view stays close to what appears in the terminal.

The integration follows the platform: it uses a pseudo-terminal on Linux and macOS and pipes on Windows. The difference is documented because applications may change buffering or formatting depending on how their output is connected.

Use cases

Multiple machines can share the same bot configuration, with the hostname identifying each dashboard. This is useful for personal workstations and research servers where jobs run independently. Bot credentials and the permitted chat are supplied through environment variables, command-line arguments, or a configuration file.

The design remains intentionally small: it is a remote view and control surface for an existing process, not a scheduler. PyPI is the simplest installation path, while the repository contains configuration examples, platform notes, and a long-running demo that exercises different terminal-output styles.

Because Telegram can expose logs and process controls, the bot token and chat identifier should be treated as credentials and kept out of source control.

Resources