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.6.tar.gz (2.2 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.6-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eztelegramapi-0.1.6.tar.gz
  • Upload date:
  • Size: 2.2 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.6.tar.gz
Algorithm Hash digest
SHA256 d845c226b4dabbdc7c1ee89f1015a7245c291319de92a3d1d70d8de07f449767
MD5 3215a1304b88fbef90241ec69aafd66d
BLAKE2b-256 a834a7288725971eced5b084a416d69b92fe2838aed1f5263d46fb5ca952305b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eztelegramapi-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 69b85bfcb4c7049accbd9b64ddf3d67fc368fc14892858816e5aa6132f0bb6c0
MD5 16fd099fb7f1e0ab93b910d278e1eb5b
BLAKE2b-256 4aa341c7435d123f5f9f8e6c35253570ffcac94e62f13d9ce91e8d45c78c0a94

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