Python SDK
The zapinner package is an idiomatic Python client (3.8+) built on httpx, with auth, timeouts, and transient-failure retries handled for you.
Install
The
zapinner package is implemented and package-ready but not yet published to PyPI. Until it ships, install from source or a git ref; the command below is the intended install once publication happens.shell
pip install zapinnerInitialize
client.py
from zapinner import Zapinner
zap = Zapinner(api_key="zap_live_...") # or set ZAPINNER_API_KEY
# Zapinner(base_url="https://zapinner.com", timeout=30.0, max_retries=2)Call Zapinner from your server or a trusted environment. Never embed a live key in a distributed client or notebook you share.
Calling capabilities
examples.py
# Normalize messy fields
normalized = zap.normalize(data={"company": " ACME, INC. ", "amount": "$1,245.00"})
# Verify a claim against evidence
verdict = zap.verify(
claim="Invoice was paid in full",
evidence=[{"source": "payment_ledger", "value": "Payment of $11,840 received"}],
)
# Reconcile two datasets
result = zap.reconcile(
source_a={"name": "orders", "records": [{"id": "SO-1", "total": 12500}]},
source_b={"name": "invoices", "records": [{"id": "SO-1", "total": 11840}]},
matching={"primary_keys": ["id"], "amount_field": "total"},
)normalize,dedupe,match,compare,explain,anomaliesscore,verify,analyze,reconcile,revenue_leak,lead_recoverytransform,validate,extract,web_extract- Async batch jobs:
submit_job,get_job,wait_for_job - Limited preview (enabled per account):
execute,workflow_run
Connection reuse
Use the client as a context manager to close the underlying HTTP pool when you're done:
context.py
with Zapinner() as zap:
zap.score(factors=[{"name": "email_match", "value": 0.9}])Error handling
errors.py
from zapinner import ZapinnerError
try:
zap.reconcile(source_a=..., source_b=..., matching=...)
except ZapinnerError as err:
print(err.code, err.status, err.request_id, err.details)
if err.is_rate_limited:
... # back off, or prompt an upgradePrefer raw HTTP? See the API reference.
