Skip to main content

Communicate your project updates via Telegram Bot!

Project description

ChaterJee

ChaterJee

Often, we need to run computational trial and error experiments by just tweaking one or two key parameters. In machine learning, you face similar problems during hyperparameter tuning experiments.

These are probably the most boring, time-consuming, yet unavoidable phases in our day-to-day research. But what if your experiments could keep working while you're at a date XD ? What if you could kick off a hyperparameter tuning run just before bed — and wake up with results and plots waiting on your phone, like a good morning message from your research? Real-time updates, one-tap reruns, and zero late-night debugging. It’s like having a research assistant in your pocket.

Let me introduce ChaterJee to you — a playful fusion of Chater, meaning one who chats, and Jee, an honorific used in Indian culture to show respect. Think of ChaterJee as the lab assistant you always wanted — one who actually responds, never crashes your code, doesn't ask for co-authorship, and definitely doesn't need coffee all the time, unlike you.

Installation

You need two things:

  1. The ChaterJee module
  2. A telegram BOT that you own

Installing the module

I recommend to install ChaterJee module inside your project's conda environment for a seamless experience.

conda activate yourenv
pip install ChaterJee

Get your telegram BOT

To use this ChaterJee, you'll need a Telegram Bot Token and your Chat ID. Follow these simple steps:

Create a Bot and Get the Token

  • Open Telegram and search for @BotFather.
  • Start a chat and send the command /newbot.
  • Follow the prompts: choose a name and a username for your bot.
  • Once done, BotFather will give you a bot token — a long string like 123456789:ABCdefGhiJKlmNoPQRsTuvWXyz.

Get Your Chat ID

  • Open Telegram and start a chat with your newly created bot by searching its username.

  • Send Hi (any message) to your bot.

  • Open your browser and visit this URL, replacing YOUR_BOT_TOKEN with your token: https://api.telegram.org/bot{YOUR_BOT_TOKEN}/getUpdates

    with the above token, this URL becomes: https://api.telegram.org/bot123456789:ABCdefGhiJKlmNoPQRsTuvWXyz/getUpdates

  • Look for "chat":{"id":...} in the JSON response. This number is your Chat ID.

Quick Start

ChaterJee has two components.

  • NoteLogs class: This stores log files, and save project locations for parsing updates.
  • ChatLogs class: This reads log files, the last line is sent to you via the BOT. It can also share you final plots that you need for your next rerun.

The minimal example

This will register your JOB with the given JOB_NAME and logfiles into a JSON file, <your home>/.data/JOB_status.json.

# This is a minimal example
import ChaterJee

# your code here
JOB_NAME = "job_0.1.10"
OUT_NAME = "experiment_0.1"

for i in range(N):
    # Your code here
    notelogs = ChaterJee.NoteLogs()
    notelogs.write(f"{JOB_NAME}",\
    logSTRING=f"Step {i} done.",\
    logFILE=f"{OUT_NAME}.log",\
    logIMAGE=f"{OUT_NAME}.png")

Next step is to receive updates on your projects.

# Run this instance separately to parse job updates
# This is the one which actually communicates with your BOT.

import ChaterJee

if __name__ == '__main__':
    TOKEN = '123456789:ABCdefGhiJKlmNoPQRsTuvWXyz'
    CHATID = '123456789'

    cbot = ChaterJee.ChatLogs(TOKEN, CHATID)
    cbot.cmdTRIGGER()

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chaterjee-0.2.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chaterjee-0.2.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file chaterjee-0.2.4.tar.gz.

File metadata

  • Download URL: chaterjee-0.2.4.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for chaterjee-0.2.4.tar.gz
Algorithm Hash digest
SHA256 1b32b125ffa48e5c21626a61d540a154b36301875206f5cdd96f07f7bcfaa4d1
MD5 25e81d578c9b4d9ccbff860bda73c633
BLAKE2b-256 ee5a3160e0924b9ca4b527baedec11218ae8f790b3ee7df2d5f052dd801a0d8e

See more details on using hashes here.

File details

Details for the file chaterjee-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: chaterjee-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for chaterjee-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e13b245e2dd0347f69f8371cb90a0356019cd323364e55a9014e28b3843ab402
MD5 4867da654baf4764860207d527a403cc
BLAKE2b-256 f377fc90ca3284065461e349b054459234786139427621d5100f3081e6bf2c60

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page