Skip to content

Extension for tqdm progressbar in Telegram

License

Notifications You must be signed in to change notification settings

pituganov/telelog

 
 

Repository files navigation

telelog

Extension for tqdm progressbar and text logging in Telegram

Installation

Now the project can not be found in PyPI

But you can install from git:

pip install git+https://github.com/pituganov/telelog

Before usage of lib you need ann environment variables with bot token, chat id and proxy (optional).

Example:

TELELOG_BOT_TOKEN=TELEGRAM_BOT_TOKEN
TELELOG_CHAT_ID=CHAT_ID
# optional
TELELOG_PROXY=PROXY

Usage

import time
from telelog import tqdm, send_text

for _ in tqdm(range(1000)):
    time.sleep(0.1)

send_text('Hello World')

Tips

You can use this from different python scripts in parallel

tg_tqdm_how_it_work

What TELEGRAM_BOT_TOKEN and CHAT_ID?

You must create a bot that will send you the progress bar. But it's easy!

  • TELEGRAM_BOT_TOKEN
  1. Find @BotFather in Telegram

  2. Follow the instructions to create a new bot. Video guide: tg_tqdm_how_create_bot

    in video my TELEGRAM_BOT_TOKEN is 639207352:AAFJKonqGVcHIkMHLm46h1UVH7mtU4xJD70

  • CHAT_ID
  1. Open the chat with your new bot
  2. Write to him /start and one more message
  3. Run this code (where TELEGRAM_BOT_TOKEN from prev step)
import telepot
bot = telepot.Bot(TELEGRAM_BOT_TOKEN)
bot.getUpdates()[0]['message']['chat']['id']
  1. Result is you CHAT_ID

About

Extension for tqdm progressbar in Telegram

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%