Skip to main content

tgtqdm

tgtqdm banner

who needs work-life balance when you can watch your logs on the phone?

I made this because I wanted to watch my scripts go brr while I'm away from my computer

pip install tgtqdm

Replace your tqdm bar with this:

import time
from tgtqdm import tgtqdm

for i in tgtqdm(
    range(33),
    json_filename="telegram_info.json",
    desc="running something"
):
    ## do something
    time.sleep(1)

The json file should look like this:

{
    "api_token": "TOKEN",
    "chat_id": 123456789
}

How do I get an API token and a chat ID?

You can also manually log messages like this:

from telegram_logger import TelegramLogger

logger = TelegramLogger(
    api_token="...",
    chat_id=123
)

## when you log for the first time, it will send a message
logger.log(message="Lettuce begin", timestamp=False)

## when you log again, it will update the existing message
logger.log(message="Legume resume", timestamp=False)

Alternatively, you can also safely store your api token and chat ID in a json and initialize your logger from the filename. This is usually safer for dummies

logger = TelegramLogger.from_json(
    filename="telegram_info.json"
)

Metadata

Release files for tgtqdm 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tgtqdm 0.0.2
File Size Uploaded
tgtqdm-0.0.2.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tgtqdm 0.0.2
File Interpreter ABI Platform
tgtqdm-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / tgtqdm-0.0.2.tar.gz

Download URL tgtqdm-0.0.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2e8f2780faad9de7aeb649f6f42fef53681a59b0b4cf5782058dee1886b54799
BLAKE2b-256 checksum
How to use checksums
6ccedec3a9eae3f854a0b7df438a311730e1fc4a24ccb6d74472fcf6cb43b551
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / tgtqdm-0.0.2-py3-none-any.whl

Download URL tgtqdm-0.0.2-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd9627d5e5a915a8ef40f7bad642a71d0496133156d9176e198a72dd47ea60d1
BLAKE2b-256 checksum
How to use checksums
49d679cc38c90967d3f88849604cdd9b88b693a446e768d3265723291adbec4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

0.0.0

2 release 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