Pingram simplifies the process of sending Telegram messages with just one line of Python code. This ultra-lightweight wrapper focuses on efficient one-way messaging without the need for complex setups, making it the ideal choice for alerts, logs, and automated notifications.
Pingram is a lightweight Python wrapper designed for seamless communication with Telegram. This tool simplifies the process of sending outbound messages via a Telegram bot, providing a streamlined solution without the need for webhooks or complex setups. Ideal for alerts, logs, or automated notifications, Pingram excels in one-way messaging that replaces traditional email and SMS notifications.
bot.message() and bot.send_photo().python-telegram-bot (PTB), and a ~99.7% reduction in size without dependencies.Pingram is tailored for:
Using Pingram is straightforward:
from pingram import Pingram
bot = Pingram(token="<BOT_TOKEN>")
bot.me() # Verifies bot authentication
This simple command checks the bot's setup and returns relevant information.
Pingram supports sending various media formats, accommodating both local file paths and URLs:
bot.send_photo(chat_id=123456789, path="https://example.com/image.jpg", caption="Test Photo")
bot.send_doc(chat_id=123456789, path="https://example.com/file.pdf", caption="Monthly Report")
bot.send_audio(chat_id=123456789, path="https://example.com/audio.mp3", caption="Greetings.")
bot.send_video(chat_id=123456789, path="https://example.com/video.mp4", caption="Security Footage")
httpx.Pingram includes a real-world testing suite that ensures functionality by sending actual messages, which aids in identifying edge cases and validating API behavior. Future enhancements will include support for async operations, message templating, and additional robust error handling features.
For a compact yet powerful solution to manage Telegram messaging, Pingram stands as an effective choice.
No comments yet.
Sign in to be the first to comment.