Metadata-Version: 2.4
Name: nexbasira
Version: 0.1.1
Summary: Python SDK for the NexBasira public API — sessions, evidence, whiteboards, webhooks, branding, custom domains.
Author-email: NexBasira <support@nexbasira.com>
License: MIT
Project-URL: Homepage, https://github.com/codelounge-io/certivisiopro_backend/tree/main/sdks/python
Project-URL: Repository, https://github.com/codelounge-io/certivisiopro_backend
Project-URL: Issues, https://github.com/codelounge-io/certivisiopro_backend/issues
Keywords: nexbasira,remote-inspection,video-inspection,eidas,audit-evidence,livekit,webhooks,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: responses>=0.25; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# `nexbasira` — Python SDK

Python 3.10+ client for the NexBasira public API. Mirrors the
Node SDK's resource surface for ERP/CRM backends written in Python
(Odoo, Django, FastAPI).

## Install

```bash
pip install nexbasira
```

## Quickstart

```python
import os
from nexbasira import NexBasira

nb = NexBasira(
    public_key="nb_pub_...",
    secret=os.environ["NB_SECRET"],
)

# Create a session + mint a field-join URL.
session = nb.sessions.create(notes="Roof inspection — 14 Rue de Lille")
invite = nb.sessions.create_participant_invite(
    session["id"],
    role="field",
    recipient_email="field-tech@acme.com",
)
print(invite["join_url"])

# Iterate evidence (auto-paginated).
for ev in nb.evidence.list(session["id"]):
    print(ev["kind"], ev["sha256"])

# List saved whiteboards.
for wb in nb.whiteboards.list(session["id"]):
    print(wb["id"], wb["byte_size"])
```

## Webhook verification

```python
from nexbasira import construct_event, InvalidSignatureError

@app.post("/nb-webhook")
def handle_webhook(request):
    try:
        event = construct_event(
            request.body,
            request.headers["nb-signature"],
            os.environ["NB_WEBHOOK_SECRET"],
        )
    except InvalidSignatureError:
        return 400
    if event["type"] == "session.completed":
        ...
```

## Errors

`NexBasiraError` and its subclasses `AuthenticationError` (401),
`PermissionError` (403), `NotFoundError` (404), `RateLimitError` (429,
`.retry_after_seconds`), `InvalidSignatureError` (webhook).
