Metadata-Version: 2.4
Name: mixpeek
Version: 1.3.6
Summary: Mixpeek API
Home-page: https://github.com/mixpeek/mixpeek
Author: Mixpeek Support
Author-email: Mixpeek Support <info@mixpeek.com>
License-Expression: MIT
Project-URL: Homepage, https://mixpeek.com
Project-URL: Documentation, https://docs.mixpeek.com
Project-URL: Repository, https://github.com/mixpeek/mixpeek
Keywords: OpenAPI,OpenAPI-Generator,Mixpeek API
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2
Requires-Dist: typing-extensions>=4.7.1
Dynamic: author
Dynamic: home-page

# Mixpeek Python SDK

The official Python client for the [Mixpeek API](https://docs.mixpeek.com).

## Install

```bash
pip install mixpeek
```

## Quickstart

```python
from mixpeek import Mixpeek

client = Mixpeek(api_key="YOUR_API_KEY")

# Create a standalone namespace
client.namespaces.create(namespace_id="my-search", mode="standalone")

# Upsert documents with your own vectors
client.namespaces.documents.upsert(
    namespace_id="my-search",
    documents=[{
        "document_id": "doc-001",
        "vectors": {"embedding": [0.12, -0.34, 0.56]},
        "payload": {"title": "First document", "category": "demo"},
    }],
)

# Search (vectors are searchable within ~10-30 seconds of upsert)
results = client.search(
    namespace_id="my-search",
    queries=[{
        "vector_name": "embedding",
        "vector": [0.15, -0.28, 0.44],
        "top_k": 10,
    }],
)
```

## Authentication

Pass your API key directly or set the `MIXPEEK_API_KEY` environment variable:

```python
# Explicit
client = Mixpeek(api_key="sk_...")

# From environment
import os
os.environ["MIXPEEK_API_KEY"] = "sk_..."
client = Mixpeek()
```

## Namespace-scoped operations

Set a default namespace to avoid passing it on every call:

```python
client = Mixpeek(api_key="sk_...", namespace="ns_abc123")

# Uses the default namespace
results = client.search(query="red shoes", collection="products", limit=20)
```

## Resources

The client exposes resource managers for the full API:

```python
client.namespaces            # create, list, get, delete
client.namespaces.documents  # upsert (BYO vectors)
client.buckets               # create, list, get, delete, upload
client.collections           # create, list, get, delete, trigger
client.retrievers            # create, list, get, delete, execute
client.documents             # list, get, delete, update, search
```

## Requirements

- Python 3.9+
- No heavy dependencies (uses `urllib3` for HTTP)

## Links

- [Documentation](https://docs.mixpeek.com)
- [API Reference](https://docs.mixpeek.com/api-reference)
- [Quickstart Guide](https://docs.mixpeek.com/overview/quickstart)
- [GitHub](https://github.com/mixpeek/mixpeek)
