Metadata-Version: 2.4
Name: tauth-sdk
Version: 0.1.0
Summary: Python SDK for Tauth — C2PA media provenance and signing
Author-email: Tauth <dev@tauth.io>
License-Expression: MIT
Project-URL: Homepage, https://tauth.io
Project-URL: Documentation, https://docs.tauth.io
Project-URL: Repository, https://github.com/tauth-io/tauth-python
Keywords: c2pa,content-authenticity,media-provenance,digital-signing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Multimedia
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31

# tauth-sdk

Python SDK for [Tauth](https://tauth.io) — sign media files with C2PA content credentials and register provenance on Ethereum.

## Installation

```bash
pip install tauth-sdk
```

## Quick start

```python
from tauth import TauthClient

client = TauthClient(api_key="tk_...")

# Sign a file
result = client.sign("photo.jpg", creator="Alice Smith", description="Product launch")
print(result["tx_hash"])      # Ethereum transaction hash
print(result["download_url"]) # Signed file URL

# Verify a file
info = client.verify_file("signed_photo.jpg")
print(info["valid"])    # True
print(info["manifest"]) # C2PA manifest contents

# List all signed assets
assets = client.list_assets()
```

## API key

Generate an API key from your Tauth dashboard or via the API:

```bash
curl -X POST https://api.tauth.io/org/api-keys \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -d '{"name": "production", "scopes": ["sign", "verify"]}'
```

You can also set `TAUTH_API_KEY` in your environment instead of passing `api_key` directly.

## Supported file types

JPEG, PNG, WebP, MP4, PDF

## Reference

### `TauthClient(api_key, base_url)`

| Parameter | Default | Description |
|-----------|---------|-------------|
| `api_key` | `TAUTH_API_KEY` env | API key starting with `tk_` |
| `base_url` | `https://api.tauth.io` | Override for self-hosted |

### `sign(file_path, *, creator, description, extra_assertions)`

Returns `dict` with `asset_id`, `file_hash`, `tx_hash`, `download_url`.

### `verify_file(file_path)` / `verify_url(url)` / `verify_hash(sha256_hex)`

Returns `dict` with `valid`, `manifest`, `blockchain`.

### `list_assets()`

Returns list of asset dicts for your organization.

### `TauthError(status, detail)`

Raised on any non-2xx API response. Has `.status` (int) and `.args[0]` message.
