Skip to main content

Simple Telegram helper

Project description

EzTelegramApi

Python versions

The simplest way to send Telegram messages from Python.
One function. Zero boilerplate. Just send.


Installation

pip install EzTelegramApi

Quickstart

from eztelegramapi import send_message

TOKEN   = "123456789:AABBCCDDEEFFaabbccddeeff-1234567890"  # from @BotFather
CHAT_ID = 987654321                                         # your chat ID

send_message(TOKEN, CHAT_ID, "Hello from Python! 🚀")

That's it. Seriously.


Why EzTelegramApi?

EzTelegramApi Other libraries
Setup None Config, classes, handlers...
Lines to send a message 1 5–20+
Dependencies requests Multiple
Learning curve Zero Non-zero

API Reference

send_message(token, chat_id, text)

Parameter Type Description
token str Your bot token from @BotFather
chat_id int Target chat or user ID
text str Message text (supports emoji ✅)

Returns: requests.Response — the raw Telegram API response.


Examples

Alert on error:

try:
    risky_operation()
except Exception as e:
    send_message(TOKEN, CHAT_ID, f"🔴 Error: {e}")

Cron job notification:

from datetime import datetime

now = datetime.now().strftime("%Y-%m-%d %H:%M")
send_message(TOKEN, CHAT_ID, f"✅ Backup finished at {now}")

Send your public IP address:

import requests

ip = requests.get("https://api.ipify.org").text
send_message(TOKEN, CHAT_ID, f"🌐 My IP: {ip}")

How to get your Chat ID

  1. Start a chat with @userinfobot
  2. Send /start
  3. It replies with your numeric ID — use that as chat_id

License

MIT

Project details


Download files

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

Source Distribution

eztelegramapi-0.1.7.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

eztelegramapi-0.1.7-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file eztelegramapi-0.1.7.tar.gz.

File metadata

  • Download URL: eztelegramapi-0.1.7.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for eztelegramapi-0.1.7.tar.gz
Algorithm Hash digest
SHA256 9659df1e6fe67dff910ab75ef3d8125f804ed7368e63e0d3f1ce645aa40f7673
MD5 2e2cc599f0773409e58672d302a2f02f
BLAKE2b-256 f2dfd1a00093959a9f68ab53a96d010c38dff00b54ad51282266e68067e8e55d

See more details on using hashes here.

File details

Details for the file eztelegramapi-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: eztelegramapi-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for eztelegramapi-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7b23f70187f217d7ad561b52af4bc9e28440e6a19c7e786a2404439403a9ff27
MD5 a1c366fc7133ff97c2f82e7652e52037
BLAKE2b-256 c5c055958b2dbea9a3a992d0148cbef1e47ba3f6e005b83d1ef90a092a93d762

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