databar 2.0.8__tar.gz → 2.1.0__tar.gz

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.
Files changed (30) hide show
  1. {databar-2.0.8/src/databar.egg-info → databar-2.1.0}/PKG-INFO +125 -10
  2. {databar-2.0.8 → databar-2.1.0}/README.md +124 -9
  3. {databar-2.0.8 → databar-2.1.0}/pyproject.toml +1 -1
  4. {databar-2.0.8 → databar-2.1.0}/src/databar/__init__.py +86 -18
  5. databar-2.1.0/src/databar/cli/_guide.py +219 -0
  6. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/_onboard.py +31 -4
  7. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/app.py +4 -1
  8. databar-2.1.0/src/databar/client.py +1093 -0
  9. {databar-2.0.8 → databar-2.1.0}/src/databar/exceptions.py +1 -1
  10. {databar-2.0.8 → databar-2.1.0}/src/databar/models.py +320 -18
  11. {databar-2.0.8 → databar-2.1.0/src/databar.egg-info}/PKG-INFO +125 -10
  12. {databar-2.0.8 → databar-2.1.0}/src/databar.egg-info/SOURCES.txt +2 -1
  13. {databar-2.0.8 → databar-2.1.0}/tests/test_cli.py +1 -1
  14. databar-2.1.0/tests/test_new_features.py +489 -0
  15. databar-2.0.8/src/databar/cli/_guide.py +0 -237
  16. databar-2.0.8/src/databar/client.py +0 -626
  17. {databar-2.0.8 → databar-2.1.0}/LICENSE +0 -0
  18. {databar-2.0.8 → databar-2.1.0}/setup.cfg +0 -0
  19. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/__init__.py +0 -0
  20. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/_auth.py +0 -0
  21. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/_output.py +0 -0
  22. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/enrichments.py +0 -0
  23. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/tables.py +0 -0
  24. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/tasks.py +0 -0
  25. {databar-2.0.8 → databar-2.1.0}/src/databar/cli/waterfalls.py +0 -0
  26. {databar-2.0.8 → databar-2.1.0}/src/databar.egg-info/dependency_links.txt +0 -0
  27. {databar-2.0.8 → databar-2.1.0}/src/databar.egg-info/entry_points.txt +0 -0
  28. {databar-2.0.8 → databar-2.1.0}/src/databar.egg-info/requires.txt +0 -0
  29. {databar-2.0.8 → databar-2.1.0}/src/databar.egg-info/top_level.txt +0 -0
  30. {databar-2.0.8 → databar-2.1.0}/tests/test_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: databar
3
- Version: 2.0.8
3
+ Version: 2.1.0
4
4
  Summary: Official Databar.ai Python SDK and CLI — connect to enrichments, waterfalls, and tables via api.databar.ai
5
5
  Author-email: "Databar.ai Team" <info@databar.ai>
6
6
  License: MIT License
@@ -132,6 +132,13 @@ enrichments = client.list_enrichments()
132
132
  # Search enrichments
133
133
  enrichments = client.list_enrichments(q="phone")
134
134
 
135
+ # Paginated list (returns EnrichmentListResponse)
136
+ page = client.list_enrichments(page=1, limit=50, category="Company Data")
137
+ for e in page.items:
138
+ print(f" [{e.id}] {e.name} — {e.price} credits")
139
+ if page.has_next_page:
140
+ page2 = client.list_enrichments(page=2, limit=50)
141
+
135
142
  # Get full details (params, response fields)
136
143
  enrichment = client.get_enrichment(123)
137
144
  for param in enrichment.params:
@@ -144,6 +151,9 @@ data = client.poll_task(task.task_id)
144
151
  # Run single enrichment (sync convenience wrapper)
145
152
  data = client.run_enrichment_sync(123, {"email": "alice@example.com"})
146
153
 
154
+ # Run with pagination (for list-style enrichments)
155
+ data = client.run_enrichment_sync(123, {"query": "CEO"}, pages=3)
156
+
147
157
  # Bulk run
148
158
  data = client.run_enrichment_bulk_sync(123, [
149
159
  {"email": "alice@example.com"},
@@ -185,17 +195,25 @@ results = client.run_waterfall_bulk_sync(
185
195
  ### Tables
186
196
 
187
197
  ```python
188
- # List tables
198
+ # List and manage tables
189
199
  tables = client.list_tables()
190
-
191
- # Create a table
192
200
  table = client.create_table(name="My Leads", columns=["email", "name", "company"])
201
+ client.rename_table(table.identifier, "Leads 2026")
202
+ client.delete_table(table.identifier)
193
203
 
194
- # Get columns
204
+ # Columns
195
205
  columns = client.get_columns(table.identifier)
206
+ col = client.create_column(table.identifier, "Phone", type="text")
207
+ client.rename_column(table.identifier, col.identifier, "Mobile")
208
+ client.delete_column(table.identifier, col.identifier)
196
209
 
197
- # Get rows (paginated)
210
+ # Get rows with optional server-side filter
211
+ import json
198
212
  data = client.get_rows(table.identifier, page=1, per_page=500)
213
+ filtered = client.get_rows(
214
+ table.identifier,
215
+ filter=json.dumps({"company": {"contains": "OpenAI"}}),
216
+ )
199
217
 
200
218
  # Insert rows (auto-batched at 50)
201
219
  from databar import InsertRow, InsertOptions, DedupeOptions
@@ -213,15 +231,112 @@ print(f"Created: {len([r for r in response.results if r.action == 'created'])}")
213
231
 
214
232
  # Update rows by UUID
215
233
  from databar import BatchUpdateRow
216
-
217
234
  rows = [BatchUpdateRow(id=row_id, fields={"name": "Updated Name"})]
218
- response = client.patch_rows(table.identifier, rows)
235
+ client.patch_rows(table.identifier, rows)
219
236
 
220
237
  # Upsert rows by key column
221
238
  from databar import UpsertRow
222
-
223
239
  rows = [UpsertRow(key={"email": "alice@example.com"}, fields={"name": "Alice"})]
224
- response = client.upsert_rows(table.identifier, rows)
240
+ client.upsert_rows(table.identifier, rows)
241
+
242
+ # Delete specific rows
243
+ client.delete_rows(table.identifier, ["row-uuid-1", "row-uuid-2"])
244
+ ```
245
+
246
+ ### Enrichments on tables
247
+
248
+ ```python
249
+ # Add an enrichment (with column mapping)
250
+ result = client.add_enrichment(
251
+ table.identifier,
252
+ enrichment_id=123,
253
+ mapping={
254
+ "email": {"type": "mapping", "value": "email_col"}, # from column
255
+ "country": {"type": "simple", "value": "US"}, # static value
256
+ },
257
+ launch_strategy="run_on_click", # or "run_on_update"
258
+ )
259
+ print(f"Added enrichment #{result.id}: {result.enrichment_name}")
260
+
261
+ # Run it (run_strategy: run_all | run_empty | run_errors)
262
+ status = client.run_table_enrichment(
263
+ table.identifier,
264
+ enrichment_id=str(result.id),
265
+ run_strategy="run_empty",
266
+ )
267
+ print(f"Processing {status.processing_rows} rows")
268
+ ```
269
+
270
+ ### Waterfalls on tables
271
+
272
+ ```python
273
+ # Add a waterfall
274
+ wf = client.add_waterfall(
275
+ table.identifier,
276
+ waterfall_identifier="email_getter",
277
+ enrichments=[833, 966],
278
+ mapping={"first_name": "first_name", "company": "company"},
279
+ email_verifier=10,
280
+ )
281
+ print(f"Added waterfall #{wf.id}: {wf.waterfall_name}")
282
+
283
+ # List installed waterfalls
284
+ installed = client.get_table_waterfalls(table.identifier)
285
+
286
+ # Run the waterfall
287
+ client.run_table_enrichment(table.identifier, enrichment_id=str(wf.id))
288
+ ```
289
+
290
+ ### Exporters
291
+
292
+ ```python
293
+ # List available exporters
294
+ exporters = client.list_exporters() # plain list
295
+ page = client.list_exporters(page=1, limit=50) # paginated envelope
296
+
297
+ # Get exporter details (params, authorization info)
298
+ detail = client.get_exporter(exporters[0].id)
299
+ print(detail.params, detail.authorization.required)
300
+
301
+ # Add an exporter to a table
302
+ result = client.add_exporter(
303
+ table.identifier,
304
+ exporter_id=detail.id,
305
+ mapping={"email": {"type": "mapping", "value": "email_col"}},
306
+ )
307
+ client.run_table_enrichment(table.identifier, enrichment_id=str(result.id))
308
+ ```
309
+
310
+ ### Connectors
311
+
312
+ ```python
313
+ # Create a custom HTTP API connector
314
+ connector = client.create_connector(
315
+ name="My Scoring API",
316
+ method="post",
317
+ url="https://api.example.com/v1/score",
318
+ headers=[{"name": "Authorization", "value": "Bearer sk-xxx"}],
319
+ body=[{"name": "domain", "value": ""}],
320
+ rate_limit=60,
321
+ )
322
+
323
+ # CRUD
324
+ connectors = client.list_connectors()
325
+ c = client.get_connector(connector.id)
326
+ client.update_connector(connector.id, name="Updated API", method="post", url="https://...")
327
+ client.delete_connector(connector.id)
328
+ ```
329
+
330
+ ### Folders
331
+
332
+ ```python
333
+ # Organize tables in folders
334
+ folder = client.create_folder("My Leads")
335
+ folders = client.list_folders()
336
+ client.rename_folder(folder.id, "Leads 2026")
337
+ client.move_table_to_folder(table.identifier, folder_id=folder.id)
338
+ client.move_table_to_folder(table.identifier) # remove from folder
339
+ client.delete_folder(folder.id) # tables move to root
225
340
  ```
226
341
 
227
342
  ### Error handling
@@ -77,6 +77,13 @@ enrichments = client.list_enrichments()
77
77
  # Search enrichments
78
78
  enrichments = client.list_enrichments(q="phone")
79
79
 
80
+ # Paginated list (returns EnrichmentListResponse)
81
+ page = client.list_enrichments(page=1, limit=50, category="Company Data")
82
+ for e in page.items:
83
+ print(f" [{e.id}] {e.name} — {e.price} credits")
84
+ if page.has_next_page:
85
+ page2 = client.list_enrichments(page=2, limit=50)
86
+
80
87
  # Get full details (params, response fields)
81
88
  enrichment = client.get_enrichment(123)
82
89
  for param in enrichment.params:
@@ -89,6 +96,9 @@ data = client.poll_task(task.task_id)
89
96
  # Run single enrichment (sync convenience wrapper)
90
97
  data = client.run_enrichment_sync(123, {"email": "alice@example.com"})
91
98
 
99
+ # Run with pagination (for list-style enrichments)
100
+ data = client.run_enrichment_sync(123, {"query": "CEO"}, pages=3)
101
+
92
102
  # Bulk run
93
103
  data = client.run_enrichment_bulk_sync(123, [
94
104
  {"email": "alice@example.com"},
@@ -130,17 +140,25 @@ results = client.run_waterfall_bulk_sync(
130
140
  ### Tables
131
141
 
132
142
  ```python
133
- # List tables
143
+ # List and manage tables
134
144
  tables = client.list_tables()
135
-
136
- # Create a table
137
145
  table = client.create_table(name="My Leads", columns=["email", "name", "company"])
146
+ client.rename_table(table.identifier, "Leads 2026")
147
+ client.delete_table(table.identifier)
138
148
 
139
- # Get columns
149
+ # Columns
140
150
  columns = client.get_columns(table.identifier)
151
+ col = client.create_column(table.identifier, "Phone", type="text")
152
+ client.rename_column(table.identifier, col.identifier, "Mobile")
153
+ client.delete_column(table.identifier, col.identifier)
141
154
 
142
- # Get rows (paginated)
155
+ # Get rows with optional server-side filter
156
+ import json
143
157
  data = client.get_rows(table.identifier, page=1, per_page=500)
158
+ filtered = client.get_rows(
159
+ table.identifier,
160
+ filter=json.dumps({"company": {"contains": "OpenAI"}}),
161
+ )
144
162
 
145
163
  # Insert rows (auto-batched at 50)
146
164
  from databar import InsertRow, InsertOptions, DedupeOptions
@@ -158,15 +176,112 @@ print(f"Created: {len([r for r in response.results if r.action == 'created'])}")
158
176
 
159
177
  # Update rows by UUID
160
178
  from databar import BatchUpdateRow
161
-
162
179
  rows = [BatchUpdateRow(id=row_id, fields={"name": "Updated Name"})]
163
- response = client.patch_rows(table.identifier, rows)
180
+ client.patch_rows(table.identifier, rows)
164
181
 
165
182
  # Upsert rows by key column
166
183
  from databar import UpsertRow
167
-
168
184
  rows = [UpsertRow(key={"email": "alice@example.com"}, fields={"name": "Alice"})]
169
- response = client.upsert_rows(table.identifier, rows)
185
+ client.upsert_rows(table.identifier, rows)
186
+
187
+ # Delete specific rows
188
+ client.delete_rows(table.identifier, ["row-uuid-1", "row-uuid-2"])
189
+ ```
190
+
191
+ ### Enrichments on tables
192
+
193
+ ```python
194
+ # Add an enrichment (with column mapping)
195
+ result = client.add_enrichment(
196
+ table.identifier,
197
+ enrichment_id=123,
198
+ mapping={
199
+ "email": {"type": "mapping", "value": "email_col"}, # from column
200
+ "country": {"type": "simple", "value": "US"}, # static value
201
+ },
202
+ launch_strategy="run_on_click", # or "run_on_update"
203
+ )
204
+ print(f"Added enrichment #{result.id}: {result.enrichment_name}")
205
+
206
+ # Run it (run_strategy: run_all | run_empty | run_errors)
207
+ status = client.run_table_enrichment(
208
+ table.identifier,
209
+ enrichment_id=str(result.id),
210
+ run_strategy="run_empty",
211
+ )
212
+ print(f"Processing {status.processing_rows} rows")
213
+ ```
214
+
215
+ ### Waterfalls on tables
216
+
217
+ ```python
218
+ # Add a waterfall
219
+ wf = client.add_waterfall(
220
+ table.identifier,
221
+ waterfall_identifier="email_getter",
222
+ enrichments=[833, 966],
223
+ mapping={"first_name": "first_name", "company": "company"},
224
+ email_verifier=10,
225
+ )
226
+ print(f"Added waterfall #{wf.id}: {wf.waterfall_name}")
227
+
228
+ # List installed waterfalls
229
+ installed = client.get_table_waterfalls(table.identifier)
230
+
231
+ # Run the waterfall
232
+ client.run_table_enrichment(table.identifier, enrichment_id=str(wf.id))
233
+ ```
234
+
235
+ ### Exporters
236
+
237
+ ```python
238
+ # List available exporters
239
+ exporters = client.list_exporters() # plain list
240
+ page = client.list_exporters(page=1, limit=50) # paginated envelope
241
+
242
+ # Get exporter details (params, authorization info)
243
+ detail = client.get_exporter(exporters[0].id)
244
+ print(detail.params, detail.authorization.required)
245
+
246
+ # Add an exporter to a table
247
+ result = client.add_exporter(
248
+ table.identifier,
249
+ exporter_id=detail.id,
250
+ mapping={"email": {"type": "mapping", "value": "email_col"}},
251
+ )
252
+ client.run_table_enrichment(table.identifier, enrichment_id=str(result.id))
253
+ ```
254
+
255
+ ### Connectors
256
+
257
+ ```python
258
+ # Create a custom HTTP API connector
259
+ connector = client.create_connector(
260
+ name="My Scoring API",
261
+ method="post",
262
+ url="https://api.example.com/v1/score",
263
+ headers=[{"name": "Authorization", "value": "Bearer sk-xxx"}],
264
+ body=[{"name": "domain", "value": ""}],
265
+ rate_limit=60,
266
+ )
267
+
268
+ # CRUD
269
+ connectors = client.list_connectors()
270
+ c = client.get_connector(connector.id)
271
+ client.update_connector(connector.id, name="Updated API", method="post", url="https://...")
272
+ client.delete_connector(connector.id)
273
+ ```
274
+
275
+ ### Folders
276
+
277
+ ```python
278
+ # Organize tables in folders
279
+ folder = client.create_folder("My Leads")
280
+ folders = client.list_folders()
281
+ client.rename_folder(folder.id, "Leads 2026")
282
+ client.move_table_to_folder(table.identifier, folder_id=folder.id)
283
+ client.move_table_to_folder(table.identifier) # remove from folder
284
+ client.delete_folder(folder.id) # tables move to root
170
285
  ```
171
286
 
172
287
  ### Error handling
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "databar"
7
- version = "2.0.8"
7
+ version = "2.1.0"
8
8
  description = "Official Databar.ai Python SDK and CLI — connect to enrichments, waterfalls, and tables via api.databar.ai"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -16,6 +16,11 @@ Quick start::
16
16
  # Work with tables
17
17
  tables = client.list_tables()
18
18
  rows = client.get_rows(tables[0].identifier)
19
+
20
+ # Manage exporters, connectors and folders
21
+ exporters = client.list_exporters()
22
+ folder = client.create_folder("My Leads")
23
+ client.move_table_to_folder(tables[0].identifier, folder.id)
19
24
  """
20
25
 
21
26
  from .client import DatabarClient
@@ -31,34 +36,66 @@ from .exceptions import (
31
36
  DatabarValidationError,
32
37
  )
33
38
  from .models import (
34
- BatchInsertResponse,
35
- BatchUpdateResponse,
36
- BatchUpdateRow,
39
+ # Pricing / Category
40
+ PricingInfo,
41
+ CategoryInfo,
42
+ # User
43
+ User,
44
+ # Enrichments
37
45
  ChoiceItem,
38
46
  Choices,
39
- ChoicesResponse,
40
- Column,
41
- DedupeOptions,
42
- Enrichment,
43
47
  EnrichmentParam,
44
48
  EnrichmentResponseField,
49
+ PaginationInfo,
50
+ PaginationOptions,
45
51
  EnrichmentSummary,
46
- InsertOptions,
47
- InsertRow,
48
- RowsResponse,
52
+ Enrichment,
53
+ EnrichmentListResponse,
54
+ ChoicesResponse,
55
+ # Tasks
49
56
  RunResponse,
50
- Table,
51
- TableEnrichment,
52
57
  TaskResponse,
53
58
  TaskStatus,
54
- UpsertResponse,
55
- UpsertRow,
56
- User,
59
+ # Waterfalls
57
60
  Waterfall,
58
61
  WaterfallEnrichment,
62
+ # Tables
63
+ Table,
64
+ Column,
65
+ CreateColumnResponse,
66
+ TableEnrichment,
67
+ AddEnrichmentResponse,
68
+ AddWaterfallResponse,
69
+ InstalledWaterfall,
70
+ AddExporterResponse,
71
+ InstalledExporter,
72
+ RunEnrichmentResponse,
73
+ # Rows
74
+ RowsResponse,
75
+ InsertRow,
76
+ InsertOptions,
77
+ DedupeOptions,
78
+ BatchInsertResponse,
79
+ BatchUpdateRow,
80
+ BatchUpdateResponse,
81
+ UpsertRow,
82
+ UpsertResponse,
83
+ # Exporters
84
+ Exporter,
85
+ ExporterListResponse,
86
+ ExporterParam,
87
+ ExporterResponseField,
88
+ Connection,
89
+ AuthorizationInfo,
90
+ ExporterDetail,
91
+ # Connectors
92
+ NameValue,
93
+ Connector,
94
+ # Folders
95
+ Folder,
59
96
  )
60
97
 
61
- __version__ = "2.0.8"
98
+ __version__ = "2.1.0"
62
99
  __all__ = [
63
100
  "DatabarClient",
64
101
  # exceptions
@@ -71,23 +108,41 @@ __all__ = [
71
108
  "DatabarRateLimitError",
72
109
  "DatabarTaskFailedError",
73
110
  "DatabarTimeoutError",
74
- # models
111
+ # pricing / category
112
+ "PricingInfo",
113
+ "CategoryInfo",
114
+ # user
75
115
  "User",
76
- "Enrichment",
116
+ # enrichments
77
117
  "EnrichmentSummary",
118
+ "Enrichment",
119
+ "EnrichmentListResponse",
78
120
  "EnrichmentParam",
79
121
  "EnrichmentResponseField",
122
+ "PaginationInfo",
123
+ "PaginationOptions",
80
124
  "ChoiceItem",
81
125
  "Choices",
82
126
  "ChoicesResponse",
127
+ # tasks
83
128
  "RunResponse",
84
129
  "TaskResponse",
85
130
  "TaskStatus",
131
+ # waterfalls
86
132
  "Waterfall",
87
133
  "WaterfallEnrichment",
134
+ # tables
88
135
  "Table",
89
136
  "Column",
137
+ "CreateColumnResponse",
90
138
  "TableEnrichment",
139
+ "AddEnrichmentResponse",
140
+ "AddWaterfallResponse",
141
+ "InstalledWaterfall",
142
+ "AddExporterResponse",
143
+ "InstalledExporter",
144
+ "RunEnrichmentResponse",
145
+ # rows
91
146
  "RowsResponse",
92
147
  "InsertRow",
93
148
  "InsertOptions",
@@ -97,4 +152,17 @@ __all__ = [
97
152
  "BatchUpdateResponse",
98
153
  "UpsertRow",
99
154
  "UpsertResponse",
155
+ # exporters
156
+ "Exporter",
157
+ "ExporterListResponse",
158
+ "ExporterParam",
159
+ "ExporterResponseField",
160
+ "Connection",
161
+ "AuthorizationInfo",
162
+ "ExporterDetail",
163
+ # connectors
164
+ "NameValue",
165
+ "Connector",
166
+ # folders
167
+ "Folder",
100
168
  ]