Metadata-Version: 2.1
Name: mailos
Version: 0.1.0
Summary: An AI-powered email monitoring and response system
Author-email: Ivan Iufriakov <tomatyss@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Ivan Iufriakov
        
        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.
Project-URL: Homepage, https://github.com/tomatyss/mailos
Project-URL: Repository, https://github.com/tomatyss/mailos.git
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pywebio>=1.8.3
Requires-Dist: apscheduler>=3.11.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: openai>=1.57.0
Requires-Dist: anthropic>=0.40.0
Requires-Dist: aioboto3>=13.2.0
Requires-Dist: click>=8.1.7
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: flake8-docstrings; extra == "dev"
Requires-Dist: flake8-quotes; extra == "dev"
Requires-Dist: flake8-bugbear; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: sphinx-autobuild>=2024.2.4; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "docs"
Requires-Dist: myst-parser>=2.0.0; extra == "docs"

# Mailos

Mailos is a Python package that transforms any email inbox into an intelligent agent powered by Large Language Models (LLMs). It monitors email accounts and can automatically respond to incoming messages using various AI providers including OpenAI, Anthropic, and AWS Bedrock.

## Features

- 🤖 Multiple LLM Provider Support (OpenAI, Anthropic Claude, AWS Bedrock)
- 📧 IMAP Email Monitoring
- ⚡ Real-time Email Processing
- 🔄 Automatic Response Generation
- 🎯 Smart Reply Filtering
- 🌐 Web-based Configuration Interface
- ⏱️ Scheduled Email Checking

## Installation

```bash
pip install mailos
```

## Quick Start

1. Launch the web interface:

```bash
mailos
```

2. Open your browser and navigate to `http://localhost:8080`

3. Click "Add New Checker" and configure your email account:
   - Email credentials (IMAP server, port, etc.)
   - LLM provider settings
   - Auto-reply preferences

## Configuration

### Email Settings
- IMAP server and port
- Email address and password
- Monitoring frequency

### LLM Provider Options

#### OpenAI

```json
{
    "llm_provider": "openai",
    "model": "gpt-4",
    "api_key": "your-api-key"
}
```

#### Anthropic Claude

```json
{
    "llm_provider": "anthropic",
    "model": "claude-3-sonnet",
    "api_key": "your-api-key"
}
```

#### AWS Bedrock (Claude)

```json
{
    "llm_provider": "bedrock-anthropic",
    "model": "anthropic.claude-3-sonnet",
    "aws_access_key": "your-access-key",
    "aws_secret_key": "your-secret-key",
    "aws_region": "us-east-1"
}
```

## Development

1. Clone the repository:

```bash
git clone https://github.com/tomatyss/mailos.git
cd mailos
```

2. Create a virtual environment:

```bash
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
```

3. Install development dependencies:

```bash
pip install -e ".[dev]"
```

4. Run tests:

```bash
pytest
```

## Architecture

The package consists of several key components:

1. **Email Monitor**: Continuously checks for new emails using IMAP

```python:src/mailos/check_emails.py
startLine: 29
endLine: 78
```

2. **LLM Integration**: Supports multiple AI providers through a unified interface

```python:src/mailos/vendors/models.py
startLine: 8
endLine: 65
```

3. **Reply Handler**: Manages email response generation and filtering

```python:src/mailos/reply.py
startLine: 169
endLine: 192
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Author

Ivan Iufriakov (tomatyss@gmail.com)

## Acknowledgments

- PyWebIO for the web interface
- APScheduler for task scheduling
- OpenAI, Anthropic, and AWS for their LLM services
