Metadata-Version: 2.5
Name: brussle
Version: 1.0.0
Summary: Python SDK for the Brussle API
License-Expression: LicenseRef-Proprietary
Requires-Python: >=3.9
Requires-Dist: httpx<1,>=0.27
Requires-Dist: typing-extensions>=4.7
Description-Content-Type: text/markdown

# brussle (Python)

```python
from brussle import And, Client

db = Client(api_key="...")
ns = db.namespace("acme/prod/tenant_123")
ns.write(upsert=[{"id": "t_123", "attributes": {"plan": "pro"}, "state": {"subject": "Refund"}}])
page = ns.query(filters=And(("attributes.plan", "Eq", "pro"), ("answers.needs_escalation.p", "Gte", 0.85)), top_k=10)
```

To load many documents, `import_documents` takes any iterable and writes it in batches, 4 at a time on a thread pool, with retries:

```python
summary = ns.import_documents(records(), concurrency=4)
print(summary.documents, summary.failures)
```

Methods mirror the API's routes. Every route that changes something takes `idempotency_key=`. Reads, writes and calls with a key are retried after network errors, timeouts and 5xx, 2 times by default (`max_retries`). Requests and responses are plain JSON, typed in `brussle.types`. Filters and `rank_by` are tuples. Errors raise `ApiError` with the API's `code` and `details`, or `unknown` for an error response that is not the API's JSON (such as a proxy's error page), or a success whose body is not JSON. A call your organization's plan doesn't include raises `plan_required` (402), and `details["required_plan"]` names the plan that does. See [the SDK overview](../README.md).
