tgtqdm
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?
- For your own API token, go to t.me/botfather in telegram and create a new bot
- For your chat id, go to t.me/userinfobot in telegram
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tgtqdm-0.0.2.tar.gz | 4.1 kB | Without provenance | Details for tgtqdm-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tgtqdm-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for tgtqdm-0.0.2-py3-none-any.whl |
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
|
Security for tgtqdm 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.