datalab-python-sdk 0.9.1__tar.gz → 0.9.2__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.9.1 → datalab_python_sdk-0.9.2}/CHANGELOG.md +10 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/PKG-INFO +1 -1
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/cli.py +8 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/models.py +4 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/pyproject.toml +1 -1
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_api_consistency.py +1 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_cli_options.py +9 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/uv.lock +1 -1
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/.github/workflows/ci.yml +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/.gitignore +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/.pre-commit-config.yaml +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/.python-version +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/LICENSE +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/README.md +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/08-Lambda-Calculus.pptx +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/adversarial.pdf +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/bid_evaluation.docx +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/book_review.ppt +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/book_store.xls +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/chi_hind.png +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/how_to_read.doc +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/normandy.epub +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/sample-1-sheet.xlsx +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/thinkpython.pdf +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/data/vibe.html +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/__init__.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/auth.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/client.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/exceptions.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/mimetypes.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/datalab_sdk/settings.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/integration/README.md +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/integration/__init__.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/integration/test_live_api.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/integration/test_readme_examples.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/pytest.ini +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/README.md +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/end_to_end_workflow.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_api_tutorial/1_get_step_types.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_api_tutorial/2_get_workflows.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_api_tutorial/3_create_workflow.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_api_tutorial/4_execute_workflow.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_api_tutorial/5_poll_workflow.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_api_tutorial/README.md +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_definitions/README.md +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_definitions/eval_segmentation.json +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_definitions/parse_segment.json +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_definitions/segment_parallel_extract.json +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/workflow_definitions/slack_alert.json +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/__init__.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/conftest.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_cli_simple.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_client_methods.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_device_login.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_errors.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_new_endpoints.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_progress.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_results.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_transport_audit.py +0 -0
- {datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/tests/test_workflows.py +0 -0
|
@@ -3,6 +3,16 @@
|
|
|
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.9.2
|
|
7
|
+
|
|
8
|
+
New:
|
|
9
|
+
|
|
10
|
+
- **Open beta:** `ExtractOptions(citation_granularity="phrase")` and the
|
|
11
|
+
`extract --citation_granularity phrase` CLI flag. Each citation then gives
|
|
12
|
+
the exact words of the value in its block, their offset and length, a match
|
|
13
|
+
score, and a box in page pixels when the phrase has its own box. The default
|
|
14
|
+
stays block IDs. The citation format may change.
|
|
15
|
+
|
|
6
16
|
## 0.9.1
|
|
7
17
|
|
|
8
18
|
Changed:
|
|
@@ -658,6 +658,12 @@ def convert(
|
|
|
658
658
|
default=None,
|
|
659
659
|
help="Extraction mode (the API default is balanced)",
|
|
660
660
|
)
|
|
661
|
+
@click.option(
|
|
662
|
+
"--citation_granularity",
|
|
663
|
+
type=click.Choice(["block", "phrase"]),
|
|
664
|
+
default=None,
|
|
665
|
+
help="Citation detail: block ids (the API default) or the exact phrase of each value (open beta)",
|
|
666
|
+
)
|
|
661
667
|
@click.option(
|
|
662
668
|
"--save_checkpoint", is_flag=True, help="Save a checkpoint for later calls"
|
|
663
669
|
)
|
|
@@ -672,6 +678,7 @@ def extract(
|
|
|
672
678
|
output_format: str,
|
|
673
679
|
mode: Optional[str],
|
|
674
680
|
extraction_mode: Optional[str],
|
|
681
|
+
citation_granularity: Optional[str],
|
|
675
682
|
save_checkpoint: bool,
|
|
676
683
|
webhook_url: Optional[str],
|
|
677
684
|
api_key: str,
|
|
@@ -695,6 +702,7 @@ def extract(
|
|
|
695
702
|
checkpoint_id=checkpoint_id,
|
|
696
703
|
output_format=output_format or "markdown",
|
|
697
704
|
extraction_mode=extraction_mode,
|
|
705
|
+
citation_granularity=citation_granularity,
|
|
698
706
|
save_checkpoint=save_checkpoint,
|
|
699
707
|
webhook_url=webhook_url,
|
|
700
708
|
max_pages=max_pages,
|
|
@@ -141,6 +141,10 @@ class ExtractOptions(ProcessingOptions):
|
|
|
141
141
|
# Extraction mode: turbo, fast, balanced, accurate. None lets the API
|
|
142
142
|
# choose (the default is balanced). Turbo needs a file, not a checkpoint.
|
|
143
143
|
extraction_mode: Optional[str] = None
|
|
144
|
+
# Citation granularity: "block" (the API default) returns block ids;
|
|
145
|
+
# "phrase" (open beta) returns the words, offsets, match score and box of
|
|
146
|
+
# each value.
|
|
147
|
+
citation_granularity: Optional[str] = None
|
|
144
148
|
output_format: str = "markdown" # markdown, json, html, chunks
|
|
145
149
|
save_checkpoint: bool = False
|
|
146
150
|
webhook_url: Optional[str] = None
|
|
@@ -7,7 +7,7 @@ readme = "README.md"
|
|
|
7
7
|
license = "MIT"
|
|
8
8
|
repository = "https://github.com/datalab-to/sdk"
|
|
9
9
|
keywords = ["datalab", "sdk", "document-intelligence", "api"]
|
|
10
|
-
version = "0.9.
|
|
10
|
+
version = "0.9.2"
|
|
11
11
|
description = "SDK for the Datalab document intelligence API"
|
|
12
12
|
requires-python = ">=3.11"
|
|
13
13
|
dependencies = [
|
|
@@ -111,6 +111,15 @@ def test_extract_with_schema_id_and_extraction_mode(tmp_path):
|
|
|
111
111
|
assert options.page_schema == ""
|
|
112
112
|
|
|
113
113
|
|
|
114
|
+
def test_extract_with_phrase_citations(tmp_path):
|
|
115
|
+
result, process = _run(
|
|
116
|
+
["extract", "--schema_id", "sch_1", "--citation_granularity", "phrase"],
|
|
117
|
+
tmp_path,
|
|
118
|
+
)
|
|
119
|
+
assert result.exit_code == 0, result.output
|
|
120
|
+
assert process.call_args.kwargs["options"].citation_granularity == "phrase"
|
|
121
|
+
|
|
122
|
+
|
|
114
123
|
def test_extract_needs_one_schema(tmp_path):
|
|
115
124
|
result, _ = _run(["extract"], tmp_path)
|
|
116
125
|
assert result.exit_code != 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datalab_python_sdk-0.9.1 → datalab_python_sdk-0.9.2}/recipes/workflows/end_to_end_workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|