Metadata-Version: 2.4
Name: pingram
Version: 0.3.1
Summary: Minimal Telegram alerting framework for bots and scripts.
Author: zvizr
License: MIT License
        
        Copyright (c) [2026] [zvizr]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: telegram,bot,alert,notification,notifier,push,messaging,python,minimal,selfhosted,cli,automation,infra,monitoring
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx
Dynamic: license-file


# Pingram

Pingram is an ultra-lightweight Python wrapper for sending outbound Telegram messages via your bot. It’s designed as a cost-free alternative to email and SMS, focused on one-way “ping”-style messaging — ideal for alerts, reports, logs, and automated notifications.

## Features

- Send messages, photos, documents, audio, and video
- Direct method calls: `bot.message`, `bot.send_photo`, etc.
- Minimalistic architecture (single file, no external listeners)
- Built on `httpx` (sync client)
- No webhook setup or event loop required

## Installation

```bash
pip install pingram
```

## Quickstart

```python
from pingram import Pingram

bot = Pingram(token="<BOT_TOKEN>")
bot.message(chat_id=123456789, text="Hello Friend")
```

## Media Examples

Send Photo

```python
bot.send_photo(
    chat_id=123456789,
    path="https://example.com/image.jpg",
    caption="Test Photo"
)
```

### From local file:

```python
bot.send_photo(
    chat_id=123456789,
    path="photo.jpg",
    caption="Local Image"
)
```


## Send Document

```python
bot.send_doc(
    chat_id=123456789,
    path="https://example.com/file.pdf",
    caption="Monthly Report"
)
```

## Send Audio

```python
bot.send_audio(
    chat_id=123456789,
    path="audio.mp3",
    caption="Shower Thoughts"
)
```

## Send Video

```python
bot.send_video(
    chat_id=123456789,
    path="https://example.com/clip.mp4",
    caption="Security Footage"
)
```

## Benefits

- Eliminates SMTP and SMS costs
- No server or inbound infra required
- Uses only a Telegram bot token
- Lightweight and auditable codebase
- Ideal for scripts, automation, and event pings
- Seamless integration with CLI tools, logs, or system alerts

## Planned features

- Retry and error handling
- Async mode (httpx.AsyncClient)
- Message templating engine
- Std input/message collectors
- Webhook-to-Telegram bridge
- Package tests and CI integration
