DocsSDKPython SDK

Python SDK

Official Python SDK for data science and backend integrations. It is a natural fit for notebooks, scheduled jobs and services that need to read or drive Mimasa AI resources.

Installation

Install the SDK with pip install mimasa-sdk into your project's virtual environment. The package has minimal dependencies and works across the Python versions commonly used in data science and backend services. Once installed, it can be imported as import mimasa and used immediately with an API key or OAuth token.

Configuration

Instantiate a client with mimasa.Client(api_key="...") for server-to-server automation, or pass an OAuth access token for delegated access on behalf of a specific user. By default the client targets https://api.mimasa.ai/v1 and automatically retries 429 and 5xx responses with exponential backoff. Credentials should be read from environment variables or a secrets manager rather than hardcoded in scripts or notebooks.

Usage Examples

A typical script might call client.data_sources.list() to confirm a connection is healthy, then client.reports.generate(report_id) to kick off a report, passing an idempotency_key to make the call safe to retry. List methods return an iterator that transparently follows pagination cursors, so you can loop over an entire collection without managing cursors yourself. Failures raise a MimasaApiError exposing the response's stable error code for programmatic handling.