Metadata-Version: 2.4
Name: tbbn-sdk
Version: 0.1.0
Summary: Client SDK for the TBBN Platform API (Phase 0-13 resources). STATUS: WORKING (source only) — untested, no Python toolchain in the environment this was written in. Review before shipping to production.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31

# sdk-python (`tbbn-sdk` on PyPI)

**Status: WORKING (source only) — untested.** This folder is a plain Python package, not an npm
package — it was never `@tbbn/sdk-python`; that naming only applies to the real npm packages
under `packages/sdk-*` (sdk-js, sdk-typescript, sdk-react, sdk-next, sdk-vue, sdk-rn). No Python
toolchain exists in the environment this was written in, so this code has not been run — see
`.github/workflows/sdk-python-ci.yml` for the build-verification run once this is pushed.
Written as a faithful translation of `packages/sdk-js/src/client.ts`'s full method surface (all
27 resource groups, Phase 0-13). Review before shipping to production.

Real `src`-layout Python package (`pyproject.toml`, PEP 621), type-hinted throughout, `requests`
as the only dependency. Synchronous only — simplest, most broadly compatible; an async variant
could be added later but isn't built here.

```python
from tbbn_sdk import TbbnClient

client = TbbnClient(base_url="https://sandbox-api.tbbnetwork.com", api_key="sk_sandbox_...")

offer = client.offers.create({
    "fromSellerId": "...",
    "toSellerId": "...",
    "listingIdsA": ["..."],
    "listingIdsB": ["..."],
})
```

## Installing

```bash
pip install tbbn-sdk
```

Publishes via PyPI's Trusted Publishing (GitHub OIDC) — see
`.github/workflows/sdk-python-publish.yml` (manual-trigger only). Unlike `sdk-ios`/`sdk-php`,
no public mirror is needed: PyPI never fetches source from the repo itself, it just verifies the
publishing workflow's identity, so this publishes straight from the private main repo. No
API token or secret is stored anywhere for this one.

## Webhook signature verification

```python
from tbbn_sdk import verify_webhook_signature

is_valid = verify_webhook_signature(raw_body, request.headers["X-TBBN-Signature"], signing_secret)
```

## Coverage

`auth`, `merchants`, `api_keys`, `sellers`, `listings`, `catalog`, `media`, `directory`,
`search`, `trade_engine`, `currency`, `localization`, `matching`, `recommendations`, `offers`,
`reservations`, `trade_sessions`, `checkout`, `billing`, `notifications`, `webhooks`,
`audit_logs`, `moderation`, `fraud`, `reputation`, `analytics`, `features`, `sandbox` — every
resource group `sdk-js` exposes, snake_cased per PEP 8.
