{"id":19299456,"url":"https://github.com/jeff-hykin/telepy_notify","last_synced_at":"2026-05-18T02:34:34.690Z","repository":{"id":189532760,"uuid":"680797374","full_name":"jeff-hykin/telepy_notify","owner":"jeff-hykin","description":"💾 📦 ✅ python progress notifications using telegram","archived":false,"fork":false,"pushed_at":"2023-09-05T17:33:55.000Z","size":1622,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T18:45:37.292Z","etag":null,"topics":["notifications","python","telegram"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeff-hykin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-20T12:44:31.000Z","updated_at":"2023-08-25T17:09:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"4038f87a-d382-4071-95bb-42a7ed5a931c","html_url":"https://github.com/jeff-hykin/telepy_notify","commit_stats":null,"previous_names":["jeff-hykin/telepy_notify"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/jeff-hykin/telepy_notify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff-hykin%2Ftelepy_notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff-hykin%2Ftelepy_notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff-hykin%2Ftelepy_notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff-hykin%2Ftelepy_notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeff-hykin","download_url":"https://codeload.github.com/jeff-hykin/telepy_notify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff-hykin%2Ftelepy_notify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268197060,"owners_count":24211623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["notifications","python","telegram"],"created_at":"2024-11-09T23:11:41.935Z","updated_at":"2026-05-18T02:34:29.672Z","avatar_url":"https://github.com/jeff-hykin.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\n\nSuper fast (\u003c5min setup) telegram notifications for task-completion, task progress, errors and more. This is a minimal module (one file, no pip dependencies).\n\n# How do I use this?\n\n1. `pip install telepy_notify`\n\n2. Take 30sec to get a token:\n  - open up a chat with https://t.me/botfather\n  - send `/newbot` to ^\n  - copy the token out of the response message\n\n3. DM your bot to initialize it (important!)\n\n4. Use it\n\n```python\nfrom telepy_notify import Notifier\n\n# \n# setup\n# \nnotify = Notifier(\n    # read from file\n    token_path=\"some/file/thats/git/ignored/telegram.token\",\n    # # OR read from ENV var, ex:\n    # token_env_var=\"TELEGRAM_TOKEN\",\n    # # OR give the token directly, ex:\n    # token=\"alkdsfjakjfoirj029294ijfoi24j4-2\",\n    \n    # optional: a prefix for all messages (good if multiple machines)\n    message_prefix=\"Lambda Machine: Experiment 19:\",\n    # optional: set to true when debugging to avoid a million notifications\n    disable=False,\n)\n# NOTE:\n#    other people can run your code without setting up a bot\n#    because telepy will NEVER throw errors \n#    if a notification fails, or if a token is bad\n#    it will intentionally only print warnings instead of\n#    crashing whatever long-running process you have\n\n# \n# Basic notification\n# \nnotify.send(\"Howdy!\")\nnotify.send(\"Howdy! \u003cb\u003eI'm bold\u003c/b\u003e\")\nnotify.send(\"Howdy! \u003cb\u003eI'm bold\u003c/b\u003e\\n\u003ccode\u003ething = [1,3,4]\u003c/code\u003e\")\n\n# \n# get duration and/or error information\n# \nwith notify.when_done:\n    blah_blah_blah = 10\n    for blah in range(blah_blah_blah):\n        from time import sleep\n        sleep(0.1)\n    raise Exception(f'''Hello Telegram :)''')\n# \"\"\"\n# process took: 1sec, ended at: Sun Aug 20 11:23:38 2023 however it ended with an error: Exception('Hello Telegram :)')\n# \"\"\"\n\n# \n# Progress notifications\n# \n#    - gives ETA and other time-info\n#    - can limit notify-rate (by time passed or percent-progress)\n#        e.g. percent_per_notify=50 =\u003e message me after 50% progress\n#        e.g. minutes_per_notify=30 =\u003e message once every 30min\n#    - notify_iter_delay is used to wait a few iterations before sending an ETA\n#      (makes the ETA of the first notification more accurate)\nfor progress, epoch in notify.progress(range(100), percent_per_notify=50, minutes_per_notify=30, notify_iter_delay=1):\n    index = progress.index\n    \n    # do stuff\n    import random\n    accuracy = random.random()\n    if accuracy \u003e 0.99:\n        notify.send(\"Gottem 🎉🎉🎉\")\n    # end do stuff\n    \n    progress.message = f\"recent accuracy: \u003ccode\u003e{accuracy}\u003c/code\u003e\"\n\n# that^ outputs:\n# message1:\n#     [=================\u003e.................] 50.00% \n#     |  50/100 \n#     | remaining: 0sec \n#     | eta: 11:52:48 \n#     | elapsed: 0sec \n#     | recent accuracy: 0.5086382690344122\n# message2:\n#     Done in 1sec at 11:52:49\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeff-hykin%2Ftelepy_notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeff-hykin%2Ftelepy_notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeff-hykin%2Ftelepy_notify/lists"}