Metadata-Version: 2.4
Name: nbnotify
Version: 0.1.0
Summary: Unified messaging library for Telegram, Discord, and Slack.
Home-page: https://github.com/yourusername/nbnotify
Author: Your Name
Author-email: you@example.com
License: MIT
Project-URL: Homepage, https://github.com/yourusername/nbnotify
Project-URL: Documentation, https://yourusername.github.io/nbnotify
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Dynamic: author
Dynamic: author-email
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# nbnotify

A unified Python library for sending messages and images to **Telegram**, **Discord**, and **Slack** — with a single, consistent API.

Perfect for Jupyter notebooks, ML training scripts, or any long-running process where you want real-time notifications.

---

## Installation

```bash
pip install nbnotify
```

Or via conda:
```bash
conda install -c conda-forge nbnotify
```

## Quickstart

```python
from nbnotify import configure, send_message, send_image

# Pick your platform
configure("telegram", bot_token="YOUR_TOKEN", chat_id="YOUR_CHAT_ID")

send_message("Training complete!")
send_image("results.png", caption="Final accuracy: 98.2%")
```

## Platform Setup

### Telegram
1. Create a bot via [@BotFather](https://t.me/BotFather) and get your token.
2. Send a message to your bot, then visit `https://api.telegram.org/bot<TOKEN>/getUpdates` to find your `chat_id`.

```python
configure("telegram", bot_token="123:ABC...", chat_id="987654321")
```

### Discord
1. Go to your channel → **Edit Channel → Integrations → Webhooks → New Webhook**.

```python
configure("discord", webhook_url="https://discord.com/api/webhooks/...")
```

### Slack
1. Visit [api.slack.com/apps](https://api.slack.com/apps) → **Incoming Webhooks**.

```python
# Text only
configure("slack", webhook_url="https://hooks.slack.com/services/...")

# Text + images (requires bot token)
configure("slack", webhook_url="...", bot_token="xoxb-...", chat_id="#general")
```

## API Reference

### `configure(platform, *, bot_token, webhook_url, chat_id)`
Sets up the active platform. Must be called before any other function.

### `send_message(text)`
Sends a plain-text message. Returns the API response dict.

### `send_image(image_path, caption=None)`
Sends an image file. Optionally attach a caption.

### `get_config()`
Returns the current configuration (tokens are masked).

## License
MIT
