Skip to main content

A Python package for transcribing audio files, summarizing text, and extracting information using Gemini AI and Pydantic.

Project description

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 License

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
  • YouTube Support: Automatically process YouTube URLs
  • Pydantic Validation: Ensure robust input/output handling

Supported Formats

  • .mp3 - MP3 audio files
  • .wav - WAV audio files
  • .m4a - M4A audio files
  • .ogg - OGG audio files
  • YouTube URLs

Installation

Install Mantis with pip:

pip install mantisai

Quick Start

Basic Usage

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 using a custom prompt
print(mantis.extract("path/to/local/audio.mp3", "Extract key details"))

YouTube Support

Process YouTube content with the same API:

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

Usage Notes

  • Unified Interface: Whether you're passing a .mp3 file or a YouTube URL, the functions work the same way
  • Custom Prompts: For extraction, you can provide custom prompts to guide the information retrieval
  • API Key: Ensure your Gemini AI API key is set in your environment (or in your code)
  • Default 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

For more details, see CONTRIBUTING.md

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mantisai-0.1.7.tar.gz (65.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mantisai-0.1.7-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file mantisai-0.1.7.tar.gz.

File metadata

  • Download URL: mantisai-0.1.7.tar.gz
  • Upload date:
  • Size: 65.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for mantisai-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4b21616f47ff05977a21a60a009956b6943411a7b5173d7cc7127cef10bec61f
MD5 ce8cd88df1571bab76b8a896217a5b56
BLAKE2b-256 b15449d7512178e383d086a0cb5962b113ff437aa3463f0e20a05d953461101f

See more details on using hashes here.

File details

Details for the file mantisai-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: mantisai-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for mantisai-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2dfdff947d8d67360835bc056ff86b600bd12c8c66f18fe493fef2c3bda57b35
MD5 057873bdca0b4e6fd1258d8325bc264e
BLAKE2b-256 4d9e479cebaebc1946b8e46172fb7f65059fce39987b62be192ede6a85a9b59e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page