Metadata-Version: 2.4
Name: mantisai
Version: 0.1.4
Summary: A Python package for transcribing audio files, summarizing text, and extracting information using Gemini AI and Pydantic.
Author-email: Paul Elliot <paul@paulelliot.com>
License: Apache 2.0
License-File: LICENSE
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: google-generativeai
Requires-Dist: pydantic>=1.8
Requires-Dist: python-dotenv
Requires-Dist: requests
Requires-Dist: tenacity>=8.0.0
Requires-Dist: yt-dlp
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: flake8; extra == 'dev'
Requires-Dist: sphinx; extra == 'dev'
Requires-Dist: sphinx-autodoc-typehints; extra == 'dev'
Requires-Dist: sphinx-rtd-theme; extra == 'dev'
Description-Content-Type: text/markdown

# Mantis: Audio Processing with Large Language Models

Mantis is a Python package that makes it easy to transcribe audio files, generate summaries, and extract information using large language models. Built with Pydantic for robust data validation, it provides a simple and user-friendly API for processing both local audio files and YouTube content.

[![PyPI version](https://badge.fury.io/py/mantisai.svg)](https://badge.fury.io/py/mantisai)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

## Key Features

- **Audio Transcription:** Convert audio files to text.
- **Text Summarization:** Generate concise summaries of your audio content.
- **Information Extraction:** Retrieve specific details from audio using custom prompts.
- **Structured Data:** Extract information in typed, validated formats using Pydantic models.
- **YouTube Support:** Automatically process YouTube URLs.
- **Pydantic Validation:** Ensure robust input/output handling.

## Installation

Install Mantis with pip:

```bash
pip install mantisai
```

## Quick Start

### For Local Files

```python
import mantis

# Transcribe a local audio file
print(mantis.transcribe("path/to/local/audio.mp3"))

# Summarize a local audio file
print(mantis.summarize("path/to/local/audio.mp3"))

# Extract information from a local audio file using a custom prompt
print(mantis.extract("path/to/local/audio.mp3", "Extract key details"))
```

### For YouTube URLs

```python
import mantis

# Transcribe a YouTube URL
print(mantis.transcribe("https://www.youtube.com/watch?v=example"))

# Summarize a YouTube URL
print(mantis.summarize("https://www.youtube.com/watch?v=example"))

# Extract information from a YouTube URL using a custom prompt
print(mantis.extract("https://www.youtube.com/watch?v=example", "Extract key details"))
```

## Usage Notes

- **Unified Interface:** Whether you're passing a `.mp3` file or a YouTube URL, the functions `mantis.transcribe`, `mantis.summarize`, and `mantis.extract` are used in the same way.
- **Custom Prompts:** For extraction, you can provide a custom prompt to guide the information retrieval.
- **API Key:** Ensure your Gemini AI API key is set in your environment (or in your code) as shown.
- **Default Generative Model:** Mantis uses Gemini 1.5 Flash by default.

## Contributing

We welcome contributions! Here's how you can help:

1. Fork the repository.
2. Create a feature branch.
3. Make your changes.
4. Run the tests: `python -m unittest discover tests`
5. Submit a pull request.

## License

This project is licensed under the Apache 2.0 License – see the [LICENSE](LICENSE) file for details.


