datalab-python-sdk 0.14.0__tar.gz → 0.15.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.
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/CHANGELOG.md +39 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/PKG-INFO +2 -6
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/README.md +1 -5
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/__init__.py +2 -10
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/_output_layout.py +4 -2
- datalab_python_sdk-0.15.0/datalab_sdk/_output_names.py +31 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/cli.py +18 -458
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/client.py +133 -485
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/models.py +26 -145
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/pyproject.toml +1 -1
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_cli_exit_codes.py +28 -1
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_cli_output_layout.py +13 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_comparisons.py +10 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_new_endpoints.py +63 -32
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_results.py +36 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/uv.lock +1 -1
- datalab_python_sdk-0.14.0/recipes/workflows/README.md +0 -102
- datalab_python_sdk-0.14.0/recipes/workflows/end_to_end_workflow.py +0 -205
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_api_tutorial/1_get_step_types.py +0 -60
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_api_tutorial/2_get_workflows.py +0 -47
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_api_tutorial/3_create_workflow.py +0 -156
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_api_tutorial/4_execute_workflow.py +0 -63
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_api_tutorial/5_poll_workflow.py +0 -125
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_api_tutorial/README.md +0 -143
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_definitions/README.md +0 -190
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_definitions/eval_segmentation.json +0 -71
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_definitions/parse_segment.json +0 -22
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_definitions/segment_parallel_extract.json +0 -113
- datalab_python_sdk-0.14.0/recipes/workflows/workflow_definitions/slack_alert.json +0 -41
- datalab_python_sdk-0.14.0/tests/test_workflows.py +0 -460
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/.github/workflows/ci.yml +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/.gitignore +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/.pre-commit-config.yaml +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/.python-version +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/LICENSE +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/08-Lambda-Calculus.pptx +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/adversarial.pdf +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/bid_evaluation.docx +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/book_review.ppt +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/book_store.xls +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/chi_hind.png +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/how_to_read.doc +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/normandy.epub +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/sample-1-sheet.xlsx +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/thinkpython.pdf +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/data/vibe.html +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/auth.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/exceptions.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/mimetypes.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/datalab_sdk/settings.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/integration/README.md +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/integration/__init__.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/integration/test_live_api.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/integration/test_readme_examples.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/pytest.ini +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/__init__.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/conftest.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_api_consistency.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_api_key_resolution.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_cli_options.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_cli_simple.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_client_methods.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_device_login.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_errors.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_import_warnings.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_progress.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_streaming_retries.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_sync_client_errors.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_timeout_recovery.py +0 -0
- {datalab_python_sdk-0.14.0 → datalab_python_sdk-0.15.0}/tests/test_transport_audit.py +0 -0
|
@@ -3,6 +3,45 @@
|
|
|
3
3
|
The newest release is at the top. Each export to this repository uses the
|
|
4
4
|
top section as its commit message.
|
|
5
5
|
|
|
6
|
+
## 0.15.0
|
|
7
|
+
|
|
8
|
+
Removed:
|
|
9
|
+
|
|
10
|
+
- The workflow methods (`create_workflow`, `get_workflow`, `list_workflows`,
|
|
11
|
+
`delete_workflow`, `execute_workflow`, `get_execution_status`,
|
|
12
|
+
`get_step_types`), their models (`Workflow`, `WorkflowStep`,
|
|
13
|
+
`WorkflowExecution`, `InputConfig`) and the workflow CLI commands,
|
|
14
|
+
including `visualize-workflow`. The API removed the Workflows API, so these
|
|
15
|
+
methods already failed with a 404. Use pipelines.
|
|
16
|
+
|
|
17
|
+
Deprecated:
|
|
18
|
+
|
|
19
|
+
- The custom processor management methods (`list_custom_processors`,
|
|
20
|
+
`get_custom_processor_status`, `list_custom_processor_versions`,
|
|
21
|
+
`set_active_processor_version`, `archive_custom_processor`) warn. Their
|
|
22
|
+
`/api/v1/custom_processors` routes are deprecated, and the sunset date
|
|
23
|
+
(October 31, 2026) has passed, so they can stop responding without
|
|
24
|
+
further notice. `run_custom_processor()` and `run_custom_pipeline()`
|
|
25
|
+
already warned. Run processors with `run_agent()` and
|
|
26
|
+
`AgentOptions(processor="cp_XXXXX")`.
|
|
27
|
+
|
|
28
|
+
Fixed:
|
|
29
|
+
|
|
30
|
+
- `save_output()` keeps every dot in the name you pass, so
|
|
31
|
+
`save_output("output/v1.2.report")` writes `v1.2.report.md`. Before, it
|
|
32
|
+
wrote `v1.2.md`. A path that ends in an extension `save_output()` writes or
|
|
33
|
+
a document type the API reads, such as `report.md` or `scan.jpg`, still has
|
|
34
|
+
that one extension replaced, as before. The CLI keeps the whole stem of an
|
|
35
|
+
input: `v1.2.report.pdf` saves `v1.2.report.md`, and `report.json.pdf`
|
|
36
|
+
saves `report.json.md` (before, `v1.2.md` and `report.md`).
|
|
37
|
+
- `datalab compare get` and `compare run --wait` list each file's ID and
|
|
38
|
+
status. When a file completed, they print the `compare differences`
|
|
39
|
+
command that takes the ID.
|
|
40
|
+
- The `file_id` docstrings of `get_file_metadata()`,
|
|
41
|
+
`get_file_download_url()` and `delete_file()` no longer say a hashid works:
|
|
42
|
+
the API takes the integer `file_id`.
|
|
43
|
+
- The `custom-pipeline` CLI help and warning give the passed sunset date.
|
|
44
|
+
|
|
6
45
|
## 0.14.0
|
|
7
46
|
|
|
8
47
|
Behavior changes:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datalab-python-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: SDK for the Datalab document intelligence API
|
|
5
5
|
Project-URL: Homepage, https://www.datalab.to
|
|
6
6
|
Project-URL: Documentation, https://documentation.datalab.to
|
|
@@ -35,7 +35,7 @@ pip install datalab-python-sdk
|
|
|
35
35
|
|
|
36
36
|
### Authentication
|
|
37
37
|
|
|
38
|
-
[Sign up](https://www.datalab.to
|
|
38
|
+
[Sign up](https://www.datalab.to/auth/sign_up?utm_source=gh-sdk), then get your API key from [https://www.datalab.to/app/keys](https://www.datalab.to/app/keys):
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
41
|
export DATALAB_API_KEY="your_api_key_here"
|
|
@@ -201,10 +201,6 @@ With SDK 0.9.0, `upload_files(paths, max_concurrency=5)` streams
|
|
|
201
201
|
files from disk and limits the number of active uploads. Results retain the
|
|
202
202
|
input order. Use `AsyncDatalabClient` inside an existing async event loop.
|
|
203
203
|
|
|
204
|
-
## Workflows
|
|
205
|
-
|
|
206
|
-
The Datalab API removed the Workflows API. The workflow methods and CLI commands in this SDK are deprecated, and the API does not answer them. Use pipelines instead.
|
|
207
|
-
|
|
208
204
|
## CLI Usage
|
|
209
205
|
|
|
210
206
|
The SDK includes a command-line interface:
|
|
@@ -14,7 +14,7 @@ pip install datalab-python-sdk
|
|
|
14
14
|
|
|
15
15
|
### Authentication
|
|
16
16
|
|
|
17
|
-
[Sign up](https://www.datalab.to
|
|
17
|
+
[Sign up](https://www.datalab.to/auth/sign_up?utm_source=gh-sdk), then get your API key from [https://www.datalab.to/app/keys](https://www.datalab.to/app/keys):
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
export DATALAB_API_KEY="your_api_key_here"
|
|
@@ -180,10 +180,6 @@ With SDK 0.9.0, `upload_files(paths, max_concurrency=5)` streams
|
|
|
180
180
|
files from disk and limits the number of active uploads. Results retain the
|
|
181
181
|
input order. Use `AsyncDatalabClient` inside an existing async event loop.
|
|
182
182
|
|
|
183
|
-
## Workflows
|
|
184
|
-
|
|
185
|
-
The Datalab API removed the Workflows API. The workflow methods and CLI commands in this SDK are deprecated, and the API does not answer them. Use pipelines instead.
|
|
186
|
-
|
|
187
183
|
## CLI Usage
|
|
188
184
|
|
|
189
185
|
The SDK includes a command-line interface:
|
|
@@ -40,13 +40,9 @@ from .models import (
|
|
|
40
40
|
FormFieldsResult,
|
|
41
41
|
AgentOptions,
|
|
42
42
|
AgentResult,
|
|
43
|
-
ExtractionSchemaSuggestions,
|
|
44
|
-
Workflow,
|
|
45
|
-
WorkflowStep,
|
|
46
|
-
WorkflowExecution,
|
|
47
|
-
InputConfig,
|
|
48
43
|
UploadedFileMetadata,
|
|
49
44
|
ExtractionSchema,
|
|
45
|
+
ExtractionSchemaSuggestions,
|
|
50
46
|
PipelineProcessor,
|
|
51
47
|
PipelineConfig,
|
|
52
48
|
PipelineVersion,
|
|
@@ -111,13 +107,9 @@ __all__ = [
|
|
|
111
107
|
"FormFieldsResult",
|
|
112
108
|
"AgentOptions",
|
|
113
109
|
"AgentResult",
|
|
114
|
-
"ExtractionSchemaSuggestions",
|
|
115
|
-
"Workflow",
|
|
116
|
-
"WorkflowStep",
|
|
117
|
-
"WorkflowExecution",
|
|
118
|
-
"InputConfig",
|
|
119
110
|
"UploadedFileMetadata",
|
|
120
111
|
"ExtractionSchema",
|
|
112
|
+
"ExtractionSchemaSuggestions",
|
|
121
113
|
"PipelineProcessor",
|
|
122
114
|
"PipelineConfig",
|
|
123
115
|
"PipelineVersion",
|
|
@@ -13,6 +13,7 @@ import tempfile
|
|
|
13
13
|
from pathlib import Path
|
|
14
14
|
from typing import Dict, List, Optional
|
|
15
15
|
|
|
16
|
+
from datalab_sdk._output_names import exact_output_base
|
|
16
17
|
from datalab_sdk.exceptions import DatalabError
|
|
17
18
|
|
|
18
19
|
OUTPUT_MARKER = ".datalab-output"
|
|
@@ -137,8 +138,9 @@ class OutputLayout:
|
|
|
137
138
|
return list(self._folders.values())
|
|
138
139
|
|
|
139
140
|
def output_path(self, file_path: Path) -> Path:
|
|
140
|
-
"""The save_output path of an input: its folder plus its stem
|
|
141
|
-
|
|
141
|
+
"""The save_output path of an input: its folder plus its whole stem
|
|
142
|
+
(report.json.tif saves report.json.md, report.json.html and so on)."""
|
|
143
|
+
return exact_output_base(self._folders[file_path] / file_path.stem)
|
|
142
144
|
|
|
143
145
|
def __enter__(self) -> "OutputLayout":
|
|
144
146
|
# A with statement doesn't call __exit__ when __enter__ raises, so any
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""How save_output names the files it writes from the path it's given."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from datalab_sdk.mimetypes import SUPPORTED_EXTENSIONS
|
|
6
|
+
|
|
7
|
+
# The extensions save_output replaces: the ones it writes, and the input types the
|
|
8
|
+
# API reads, so save_output("out/scan.jpg") writes out/scan.md. Any other dot belongs
|
|
9
|
+
# to the name (a stem such as "v1.2.report").
|
|
10
|
+
_REPLACED_EXTENSIONS = {
|
|
11
|
+
".md",
|
|
12
|
+
".txt",
|
|
13
|
+
".json",
|
|
14
|
+
".xml",
|
|
15
|
+
".tif",
|
|
16
|
+
".htm",
|
|
17
|
+
*SUPPORTED_EXTENSIONS,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def output_file(path: Path, suffix: str) -> Path:
|
|
22
|
+
"""`path` with `suffix` added, keeping every dot in the name except one known extension."""
|
|
23
|
+
if path.suffix.lower() in _REPLACED_EXTENSIONS:
|
|
24
|
+
path = path.with_suffix("")
|
|
25
|
+
return path.with_name(path.name + suffix)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def exact_output_base(base: Path) -> Path:
|
|
29
|
+
"""A path that save_output uses whole as the base name, dots and all
|
|
30
|
+
(report.json gives report.json.md, not report.md)."""
|
|
31
|
+
return base.with_name(base.name + ".md")
|