d2b-sdk 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
d2b/__init__.py ADDED
@@ -0,0 +1,39 @@
1
+ """D2B Python SDK — Spreadsheets for AI Agents.
2
+
3
+ A thin, agent-native client over the D2B v1 API. The ergonomics live
4
+ in behaviour, not just types:
5
+
6
+ - automatic ``Idempotency-Key`` on every mutating call (retry-safe);
7
+ - transparent retry with backoff on 429/5xx;
8
+ - problem+json errors surfaced as typed exceptions carrying
9
+ ``suggested_fix`` (written for LLMs to read and react);
10
+ - ``jobs.wait()`` for the async ingest flow;
11
+ - ``webhooks.verify_delivery()`` for the delivery HMAC + send-time check.
12
+
13
+ Quickstart::
14
+
15
+ from d2b import D2BClient
16
+
17
+ client = D2BClient(api_key="d2b_pat_...", base_url="https://d2b.dev")
18
+ wb = client.workbooks.create(title="monthly")
19
+ job = client.sources.upload(wb["id"], "sales.xlsx", wait=True)
20
+ for t in client.tables.list(wb["id"]):
21
+ print(t["name"], t["row_count"])
22
+ """
23
+ from ._version import __version__
24
+ from .client import (
25
+ ConflictError,
26
+ D2BClient,
27
+ D2BError,
28
+ NotFoundError,
29
+ PolicyError,
30
+ )
31
+
32
+ __all__ = [
33
+ "D2BClient",
34
+ "D2BError",
35
+ "ConflictError",
36
+ "NotFoundError",
37
+ "PolicyError",
38
+ "__version__",
39
+ ]
d2b/_version.py ADDED
@@ -0,0 +1,7 @@
1
+ """The one place the version is written.
2
+
3
+ ``pyproject.toml`` reads it (hatch dynamic version), and the client tags
4
+ (``X-D2B-Client`` / ``User-Agent``) derive from it, so a release bumps one
5
+ line and every surface follows.
6
+ """
7
+ __version__ = "0.1.0"