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 +39 -0
- d2b/_version.py +7 -0
- d2b/cli.py +1399 -0
- d2b/client.py +913 -0
- d2b/py.typed +0 -0
- d2b/sync.py +1033 -0
- d2b/sync_workspace.py +464 -0
- d2b/workflow_template.py +143 -0
- d2b_sdk-0.1.0.dist-info/METADATA +103 -0
- d2b_sdk-0.1.0.dist-info/RECORD +13 -0
- d2b_sdk-0.1.0.dist-info/WHEEL +4 -0
- d2b_sdk-0.1.0.dist-info/entry_points.txt +2 -0
- d2b_sdk-0.1.0.dist-info/licenses/LICENSE +21 -0
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