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.8.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.8-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eztelegramapi-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 6a0a047a76192adc945ee716d320f738d8688e99a6d9d4788d13b32e373ed975
MD5 31aa7d93362bcd1d7380cf188a0f441b
BLAKE2b-256 0614babab01122384613212746db10a828f6bae7fce32b307e26a4bcc050b6a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eztelegramapi-0.1.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 dceb8f76f38c412fcf286f45f33aa0c436fb2750804d2e716babec42cee55365
MD5 e58483c56aea846e616c516fe0e8ac94
BLAKE2b-256 ae56728dca9f385765d88857a92ef742a03b6cadb63d4247de0ca5de104b48e3

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