Skip to main content

Python SDK for the Mavi Video AI Platform

Project description

Pymavi

Python SDK for the Mavi Video AI Platform. This SDK provides a simple and intuitive interface to interact with the Mavi API for video processing, search, and analysis.

Installation

pip install pymavi

Quick Start

from pymavi import MaviClient

# Initialize the client
client = MaviClient(api_key="your_api_key")

# Upload a video
response = client.upload_video(
    video_path="path/to/video.mp4",
    callback_uri="https://your-callback-url.com/webhook"
)

# Search for videos
results = client.search_video("find me videos with cars")

# Chat with videos
response = client.chat_with_videos(
    video_nos=["video_id_1", "video_id_2"],
    message="What's happening in these videos?",
    stream=True
)

Features

  • Video upload and management
  • Natural language video search
  • Key clip extraction
  • AI-powered video chat
  • Comprehensive error handling
  • Type hints and documentation

API Reference

MaviClient

The main client class for interacting with the Mavi API.

Methods

  • upload_video(video_path: str, callback_uri: Optional[str] = None) -> Dict[str, Any]
  • search_video_metadata(start_time: Optional[int] = None, end_time: Optional[int] = None, video_status: str = "PARSE", range_bucket: int = 1, num_results: int = 10) -> Dict[str, Any]
  • search_video(search_query: str) -> Dict[str, Any]
  • search_key_clip(search_query: str, video_ids: Optional[List[str]] = None) -> Dict[str, Any]
  • chat_with_videos(video_nos: List[str], message: str, history: Optional[List[Dict[str, str]]] = None, stream: bool = False) -> Union[str, Dict[str, Any]]
  • delete_video(video_ids: List[str]) -> Dict[str, Any]

Exceptions

  • MaviError: Base exception for all Pymavi-related errors
  • MaviAuthenticationError: Raised when there are authentication-related errors
  • MaviAPIError: Raised when the API returns an error response
  • MaviValidationError: Raised when there are validation errors in the input parameters

Development

  1. Clone the repository
  2. Install development dependencies: pip install -e ".[dev]"
  3. Run tests: pytest

License

This project is licensed under the MIT License - 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

pymavi-0.1.4.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

pymavi-0.1.4-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pymavi-0.1.4.tar.gz.

File metadata

  • Download URL: pymavi-0.1.4.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pymavi-0.1.4.tar.gz
Algorithm Hash digest
SHA256 83e0d4bb750f26c483f17c607e1ae89cd39d245a4569b653d462e158478ef9cf
MD5 0da22aa9bb878b7535011c0ad8150ad7
BLAKE2b-256 e20c027826d71ffe888acd732458e5d437e90f172ec19bbe8acef0d859f19c7c

See more details on using hashes here.

File details

Details for the file pymavi-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pymavi-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pymavi-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b6225846da0a9ea42c63d117341b2d44f1eb2291583fce75716f7471c7898e40
MD5 c05c91d95574db933a14605f1fa83fdf
BLAKE2b-256 1feee2dcb53efce031b9606c33ff10dad726dd5ca8a8ff1adf3cae91078c4384

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