Metadata-Version: 2.4
Name: trustoriginality
Version: 0.1.0
Summary: Python SDK for the TrustOriginality.ai AI-content detection and provenance API
Author-email: "TrustOriginality.ai" <support@trustoriginality.ai>
License-Expression: MIT
Project-URL: Homepage, https://trustoriginality.ai
Project-URL: Documentation, https://trustoriginality.ai/developers
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28

# TrustOriginality.ai — Python SDK

Thin wrapper around the TrustOriginality.ai REST API for AI-content detection,
composite KYC verification and the signed provenance registry.

## Install

```bash
pip install trustoriginality
# Local dev from repo: pip install ./sdk/python
```

## Quick start

```python
from trustoriginality import TrustOriginality

client = TrustOriginality(api_key="to_live_...")  # create keys in the panel under API Keys

# Text
res = client.analyze_text("The content you want to analyze...")
print(res["isAIGeneratedLikely"], res["score"])

# Image — from a local file or a public URL
res = client.analyze_image(file="photo.jpg", name="Campaign visual")
res = client.analyze_image(url="https://example.com/photo.jpg")

# Audio / video work the same way
res = client.analyze_audio(file="voice.mp3")
res = client.analyze_video(url="https://example.com/clip.mp4")

# Composite KYC: ID document + selfie (+ optional voice)
res = client.verify_kyc(document="id-card.jpg", selfie="selfie.jpg", voice="sample.wav")
print(res["riskLevel"], res["recommendation"])

# Provenance registry
res = client.register_provenance(file="original.png", declaration="human-created")
print(res["contentHash"], res["verifyUrl"])
record = client.get_provenance(res["contentHash"])
```

## Errors

All non-2xx responses raise `TrustOriginalityError` with `status_code` and the
parsed API `payload`:

```python
from trustoriginality import TrustOriginality, TrustOriginalityError

try:
    client.analyze_image(url="https://example.com/missing.jpg")
except TrustOriginalityError as e:
    print(e.status_code, e.payload)
```

## Self-hosted / on-prem (TrustOriginality Box)

Point the client at your Box instead of the cloud panel:

```python
client = TrustOriginality(api_key="unused", base_url="http://box.local:8080")
```

Note: Box endpoints use `/analyze/image` style paths; cloud-specific features
(credits, provenance) are panel-only. See `TrustOriginality_Box/README.md`.
