Metadata-Version: 2.4
Name: tensoract-sdk
Version: 1.0.3
Summary: Official Python SDK for the Tensoract Platform Public API
Author: Tensoract
Project-URL: Homepage, https://tensoract.com
Project-URL: Documentation, https://tensoract.com/docs
Keywords: tensoract,sdk,api-client,annotation,ai
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# Tensoract Python SDK

The official Python client for the Tensoract Public API.

## Installation

```bash
pip install tensoract-sdk
```

For local development from source:

```bash
pip install -e ./sdks/python
```

## Authentication

### 1. API Key Authentication (`x-api-key`)

```python
from tensoract_client import TensoractClient

# Defaults to production API (https://fmn.tensoract.com:8443)
client = TensoractClient(
    api_key="fmn_live_xxxxxxxxxxxxxxxxxxxx",
)

users = client.users.list()
```

To target a custom or self-hosted deployment:

```python
client = TensoractClient(
    api_key="fmn_live_xxxxxxxxxxxxxxxxxxxx",
    base_url="https://fmn.tensoract.com:8443",
)
```

### 2. PAT Bearer Token Authentication

```python
from tensoract_client import TensoractClient

client = TensoractClient(
    token="fmn_live_xxxxxxxxxxxxxxxxxxxx",
)

user = client.users.get(1)
```

## Usage Examples

### Users API

```python
# Create a user (expects 'name' and 'roles' array, not firstName/lastName/role)
new_user = client.users.create({
    "name": "Alice Annotator",
    "email": "alice@company.com",
    "password": "TemporaryPassword123!",
    "roles": ["ANNOTATOR"],
})

# List users
users = client.users.list(page=1, limit=10)

# Get a user
user = client.users.get(new_user["id"])
```
