Metadata-Version: 2.5
Name: trustycap
Version: 2.0.0
Summary: Official TrustyCap SDK for Python. Vehicle, financing and document intelligence, protected transactions, digital life, exit paths and financing math, with the Trusty Meter and published prices.
Project-URL: Homepage, https://docs.trustycap.com/sdks/python
Project-URL: Documentation, https://docs.trustycap.com
Project-URL: Repository, https://github.com/TrustyCap-Technologies/trustycap
Author-email: "TrustyCap Technologies, Inc." <hello@trustycap.com>
License-Expression: Apache-2.0
Keywords: agents,capabilities,document-intelligence,launch-kits,mcp,metering,protected-transactions,trustycap
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
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: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: cryptography>=42; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: pyyaml>=6; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Provides-Extra: receipts
Requires-Dist: cryptography>=42; extra == 'receipts'
Description-Content-Type: text/markdown

# trustycap

Official Python SDK for the [TrustyCap API](https://docs.trustycap.com). Python 3.10+, `httpx` only.

```bash
pip install trustycap            # add [receipts] for offline receipt verification
```

```python
from trustycap import TrustyCap

sweep = TrustyCap(api_key="sk_test_...")  # or TRUSTYCAP_API_KEY

diagnosis = sweep.diagnosis.get(connection_id="cxn_...")

# plan → price → authorize → commit → verify → receipt
plan = sweep.plans.create({"intent": "sweep", "source_ids": ["src_..."], "selection": {"classes": ["promotional", "large_attachment"], "min_confidence": 0.85}})
pricing = sweep.plans.pricing(plan["planId"])
auth = sweep.plans.authorize(plan["planId"])
if auth["status"] == "authorized":
    execution = sweep.plans.commit(plan["planId"])
    done = sweep.executions.wait_for(execution["id"])
    receipt = sweep.executions.receipt(done["id"])
    assert sweep.receipts.verify(receipt)["valid"]  # Ed25519, offline, against the published JWKS

for source in sweep.sources.list(connection_id="cxn_..."):  # auto-pagination
    print(source["display_name"])

# Async
from trustycap import AsyncTrustyCap
async with AsyncTrustyCap() as sweep:
    usage = await sweep.usage.get()

# Webhooks
from trustycap import webhooks
events = webhooks.construct_event(raw_body, request.headers["Sweep-Signature"], SECRET)
```

- Every mutation sends an `Idempotency-Key` automatically (`idempotency_key=` to override).
- `SweepError` carries the RFC 9457 problem (`.code`, `.status`, `.request_id`); `RateLimitError.retry_after_seconds`.
- Models are TypedDicts generated from the canonical JSON Schemas (`trustycap._types`); the SDK is checked against every spec `operationId` in CI.

Docs: https://docs.trustycap.com/sdks/python · License: Apache-2.0
