Metadata-Version: 2.4
Name: mothership-bot
Version: 1.0.0
Summary: A minimalist framework for building Telegram bots rapidly
Project-URL: Homepage, https://github.com/guzus/mothership
Project-URL: Repository, https://github.com/guzus/mothership
Project-URL: Documentation, https://github.com/guzus/mothership/blob/main/PYTHON_README.md
Author-email: Guzus <mothership@guzus.dev>
Maintainer-email: Guzus <mothership@guzus.dev>
License: MIT License
        
        Copyright (c) 2025 Telegram Bot Mothership Contributors
        
        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.
License-File: LICENSE
Keywords: bot,framework,telegram,telegram-bot
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: google-cloud-firestore>=2.14.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: python-telegram-bot>=20.7
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: mypy>=1.7.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: python-dotenv>=1.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# Mothership - Python Edition

A minimalist framework for building Telegram bots rapidly with clean abstractions and zero boilerplate.

## Features

- **Simple Bot Definition**: Define bots with minimal code
- **Storage Abstraction**: Automatic fallback between Firestore and in-memory storage
- **Flexible Deployment**: Support for local (polling), webhooks, and serverless platforms
- **Type-Safe**: Full type hints support
- **Structured Logging**: Built-in colored, leveled logging
- **Firebase Integration**: Optional Firestore persistence

## Installation

```bash
# Using uv (recommended)
uv pip install mothership-bot

# Or using pip
pip install mothership-bot
```

## Quick Start

### 1. Create a bot file (bot.py)

```python
from mothership import BotDefinition, Update, ContextTypes, create_logger

logger = create_logger('my-bot')

async def handle_start(update: Update, context: ContextTypes.DEFAULT_TYPE):
    await update.message.reply_text('Hello! I am your bot.')

bot: BotDefinition = {
    'config': {
        'name': 'my-bot',
        'description': 'My awesome bot'
    },
    'commands': [
        {
            'command': 'start',
            'description': 'Start the bot',
            'handler': handle_start
        }
    ]
}
```

### 2. Set your bot token

```bash
export BOT_TOKEN=your_token_here
```

### 3. Run your bot

```bash
# Using the CLI
mothership run bot.py

# Or using Python directly
python -c "from mothership.cli import run_bot; import asyncio; asyncio.run(run_bot('bot.py'))"
```

## CLI Usage

The `mothership` CLI provides an easy way to run and manage your bots:

```bash
# Run a bot from a file
mothership run bot.py

# Run a bot from bots directory (looks for bots/ping_bot/__init__.py)
mothership run ping_bot

# Run on a custom port
mothership run ping_bot --port 8080

# List available bots in bots/ directory
mothership list

# Get help
mothership --help
```

## Requirements

- Python >= 3.8
- Telegram Bot Token (from @BotFather)

## Environment Variables

- `BOT_TOKEN` - Required: Telegram bot token
- `FIREBASE_PROJECT_ID` - Optional: Enable persistent storage
- `LOG_LEVEL` - Optional: Logging level (debug|info|warn|error)

## Documentation

See the main Mothership repository for full documentation.
