Python SDK for the Zazu API.
Project description
zazu-sdk
Python SDK for the Zazu API.
Install
pip install zazu-sdk
Requires Python 3.11+.
Quick start
from zazu_sdk import Zazu
client = Zazu(api_key="sk_live_...")
client.entity.get()
client.accounts.list(currency_code="MAD")
client.customers.list(q="Acme")
client.customers.create(
customer_type="business",
company_name="Acme Corp",
email="billing@acme.com",
)
client.invoices.list()
client.payment_links.cancel(payment_link_id)
client.webhook_endpoints.list()
client.checkout_sessions.create(
account_id=account_id,
amount="100.00",
success_url="https://example.com/ok",
cancel_url="https://example.com/cancel",
)
client.checkout_sessions.get(session_id)
The client picks up ZAZU_API_KEY, ZAZU_BASE_URL, ZAZU_API_VERSION, and
ZAZU_TIMEOUT from the environment if you don't pass them.
Pagination
List endpoints return a Page. Iterate one page or chase cursors:
page = client.invoices.list(limit=25)
for invoice in page:
...
# All items, automatic cursor chasing:
for invoice in client.invoices.list().auto_paging_iter():
...
Errors
Nine concrete subclasses; discriminate with isinstance:
from zazu_sdk import (
ZazuValidationError,
ZazuRateLimitError,
ZazuNotFoundError,
)
try:
client.invoices.get("nope")
except ZazuNotFoundError as err:
print(err.status, err.request_id, err.body)
except ZazuRateLimitError as err:
print("retry after", err.retry_after, "seconds")
Cross-SDK contract
zazu-sdk is one of several Zazu SDKs that all replay cassettes recorded by
the canonical zazu-ruby SDK against
staging. The wire format is snake_case JSON; request and response shapes match
across Ruby, TypeScript, Python, Go, and Rust.
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zazu_sdk-0.2.1.tar.gz.
File metadata
- Download URL: zazu_sdk-0.2.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f526e14845abdbd89279c5bdd045de17e19374f5dd310edeb1778ac1613ad2b1
|
|
| MD5 |
4485a2201da414ada77d1eb96dd6f9b2
|
|
| BLAKE2b-256 |
51b1cffa0a2ca9d34e0c7c130c53d587f5b90d921958831ee1b5a96d0421ffd5
|
Provenance
The following attestation bundles were made for zazu_sdk-0.2.1.tar.gz:
Publisher:
release.yml on getzazu/zazu-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zazu_sdk-0.2.1.tar.gz -
Subject digest:
f526e14845abdbd89279c5bdd045de17e19374f5dd310edeb1778ac1613ad2b1 - Sigstore transparency entry: 2187834317
- Sigstore integration time:
-
Permalink:
getzazu/zazu-python@1f38baa787ac9b69bbf02b1970436476e430ea95 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/getzazu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1f38baa787ac9b69bbf02b1970436476e430ea95 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zazu_sdk-0.2.1-py3-none-any.whl.
File metadata
- Download URL: zazu_sdk-0.2.1-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a89e42d95b2e7c08a2bbde9e6e5c05e82e398eaa32dd0c13c6c0234ad5632fd4
|
|
| MD5 |
9ddd5c77222838131837213ba67a9a70
|
|
| BLAKE2b-256 |
eb219204c9736b556efb86eaf16634e2bfedbfce6fa8f61bbbe9674d03bf1e0f
|
Provenance
The following attestation bundles were made for zazu_sdk-0.2.1-py3-none-any.whl:
Publisher:
release.yml on getzazu/zazu-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zazu_sdk-0.2.1-py3-none-any.whl -
Subject digest:
a89e42d95b2e7c08a2bbde9e6e5c05e82e398eaa32dd0c13c6c0234ad5632fd4 - Sigstore transparency entry: 2187834335
- Sigstore integration time:
-
Permalink:
getzazu/zazu-python@1f38baa787ac9b69bbf02b1970436476e430ea95 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/getzazu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1f38baa787ac9b69bbf02b1970436476e430ea95 -
Trigger Event:
push
-
Statement type: