landingai-ade 0.11.1__tar.gz → 0.13.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.
Potentially problematic release.
This version of landingai-ade might be problematic. Click here for more details.
- landingai_ade-0.13.0/.release-please-manifest.json +3 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/CHANGELOG.md +16 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/PKG-INFO +4 -4
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/README.md +3 -3
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/pyproject.toml +1 -1
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_client.py +13 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_version.py +1 -1
- landingai_ade-0.13.0/src/landingai_ade/lib/url_utils.py +51 -0
- landingai_ade-0.11.1/.release-please-manifest.json +0 -3
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/.gitignore +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/CONTRIBUTING.md +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/LICENSE +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/SECURITY.md +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/api.md +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/bin/check-release-environment +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/bin/publish-pypi +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/examples/.keep +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/noxfile.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/release-please-config.json +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/requirements-dev.lock +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/requirements.lock +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/__init__.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_base_client.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_compat.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_constants.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_exceptions.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_files.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_models.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_qs.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_resource.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_response.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_streaming.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_types.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/__init__.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_compat.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_datetime_parse.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_logs.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_proxy.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_reflection.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_resources_proxy.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_streams.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_sync.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_transform.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_typing.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_utils.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/lib/.keep +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/lib/__init__.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/lib/schema_utils.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/py.typed +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/resources/__init__.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/__init__.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/client_extract_params.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/client_parse_params.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/extract_response.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/parse_response.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/__init__.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/api_resources/__init__.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/api_resources/test_client.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/conftest.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/sample_file.txt +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_client.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_deepcopy.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_extract_files.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_files.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_models.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_qs.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_required_args.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_response.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_streaming.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_transform.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_utils/test_proxy.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_utils/test_typing.py +0 -0
- {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.0 (2025-09-25)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.12.0...v0.13.0](https://github.com/landing-ai/ade-python/compare/v0.12.0...v0.13.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update README examples to support doccument_url as local path ([f31d6ca](https://github.com/landing-ai/ade-python/commit/f31d6cabfea19aa8f152e8030a0d7d256733f7a2))
|
|
10
|
+
|
|
11
|
+
## 0.12.0 (2025-09-25)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.11.1...v0.12.0](https://github.com/landing-ai/ade-python/compare/v0.11.1...v0.12.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* document_url support local path ([#22](https://github.com/landing-ai/ade-python/issues/22)) ([5da57a5](https://github.com/landing-ai/ade-python/commit/5da57a55c0f674888a48af8d3d80b6fb5b55160c))
|
|
18
|
+
|
|
3
19
|
## 0.11.1 (2025-09-25)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.11.0...v0.11.1](https://github.com/landing-ai/ade-python/compare/v0.11.0...v0.11.1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: landingai-ade
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
4
4
|
Summary: The official Python library for the landingai-ade API
|
|
5
5
|
Project-URL: Homepage, https://github.com/landing-ai/ade-python
|
|
6
6
|
Project-URL: Repository, https://github.com/landing-ai/ade-python
|
|
@@ -75,7 +75,7 @@ client = LandingAIADE(
|
|
|
75
75
|
|
|
76
76
|
response = client.parse(
|
|
77
77
|
# support document or document_url
|
|
78
|
-
document_url="
|
|
78
|
+
document_url="path/to/file",
|
|
79
79
|
model="dpt-2-latest",
|
|
80
80
|
)
|
|
81
81
|
print(response.chunks)
|
|
@@ -128,7 +128,7 @@ client = AsyncLandingAIADE(
|
|
|
128
128
|
|
|
129
129
|
async def main() -> None:
|
|
130
130
|
response = await client.parse(
|
|
131
|
-
document_url="
|
|
131
|
+
document_url="path/to/file",
|
|
132
132
|
model="dpt-2-latest",
|
|
133
133
|
)
|
|
134
134
|
print(response.chunks)
|
|
@@ -164,7 +164,7 @@ async def main() -> None:
|
|
|
164
164
|
http_client=DefaultAioHttpClient(),
|
|
165
165
|
) as client:
|
|
166
166
|
response = await client.parse(
|
|
167
|
-
document_url="
|
|
167
|
+
document_url="path/to/file",
|
|
168
168
|
model="dpt-2-latest",
|
|
169
169
|
)
|
|
170
170
|
print(response.chunks)
|
|
@@ -40,7 +40,7 @@ client = LandingAIADE(
|
|
|
40
40
|
|
|
41
41
|
response = client.parse(
|
|
42
42
|
# support document or document_url
|
|
43
|
-
document_url="
|
|
43
|
+
document_url="path/to/file",
|
|
44
44
|
model="dpt-2-latest",
|
|
45
45
|
)
|
|
46
46
|
print(response.chunks)
|
|
@@ -93,7 +93,7 @@ client = AsyncLandingAIADE(
|
|
|
93
93
|
|
|
94
94
|
async def main() -> None:
|
|
95
95
|
response = await client.parse(
|
|
96
|
-
document_url="
|
|
96
|
+
document_url="path/to/file",
|
|
97
97
|
model="dpt-2-latest",
|
|
98
98
|
)
|
|
99
99
|
print(response.chunks)
|
|
@@ -129,7 +129,7 @@ async def main() -> None:
|
|
|
129
129
|
http_client=DefaultAioHttpClient(),
|
|
130
130
|
) as client:
|
|
131
131
|
response = await client.parse(
|
|
132
|
-
document_url="
|
|
132
|
+
document_url="path/to/file",
|
|
133
133
|
model="dpt-2-latest",
|
|
134
134
|
)
|
|
135
135
|
print(response.chunks)
|
|
@@ -49,6 +49,7 @@ from ._base_client import (
|
|
|
49
49
|
AsyncAPIClient,
|
|
50
50
|
make_request_options,
|
|
51
51
|
)
|
|
52
|
+
from .lib.url_utils import convert_url_to_file_if_local
|
|
52
53
|
from .types.parse_response import ParseResponse
|
|
53
54
|
from .types.extract_response import ExtractResponse
|
|
54
55
|
|
|
@@ -273,6 +274,9 @@ class LandingAIADE(SyncAPIClient):
|
|
|
273
274
|
|
|
274
275
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
275
276
|
"""
|
|
277
|
+
# Convert local file paths to file parameters
|
|
278
|
+
markdown, markdown_url = convert_url_to_file_if_local(markdown, markdown_url)
|
|
279
|
+
|
|
276
280
|
body = deepcopy_minimal(
|
|
277
281
|
{
|
|
278
282
|
"schema": schema,
|
|
@@ -351,6 +355,9 @@ class LandingAIADE(SyncAPIClient):
|
|
|
351
355
|
|
|
352
356
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
353
357
|
"""
|
|
358
|
+
# Convert local file paths to file parameters
|
|
359
|
+
document, document_url = convert_url_to_file_if_local(document, document_url)
|
|
360
|
+
|
|
354
361
|
body = deepcopy_minimal(
|
|
355
362
|
{
|
|
356
363
|
"document": document,
|
|
@@ -616,6 +623,9 @@ class AsyncLandingAIADE(AsyncAPIClient):
|
|
|
616
623
|
|
|
617
624
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
618
625
|
"""
|
|
626
|
+
# Convert local file paths to file parameters
|
|
627
|
+
markdown, markdown_url = convert_url_to_file_if_local(markdown, markdown_url)
|
|
628
|
+
|
|
619
629
|
body = deepcopy_minimal(
|
|
620
630
|
{
|
|
621
631
|
"schema": schema,
|
|
@@ -694,6 +704,9 @@ class AsyncLandingAIADE(AsyncAPIClient):
|
|
|
694
704
|
|
|
695
705
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
696
706
|
"""
|
|
707
|
+
# Convert local file paths to file parameters
|
|
708
|
+
document, document_url = convert_url_to_file_if_local(document, document_url)
|
|
709
|
+
|
|
697
710
|
body = deepcopy_minimal(
|
|
698
711
|
{
|
|
699
712
|
"document": document,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Utility functions for handling URL and file path conversions."""
|
|
2
|
+
|
|
3
|
+
from typing import Tuple, Union, Optional, cast
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from urllib.parse import urlparse
|
|
6
|
+
|
|
7
|
+
from .._types import Omit, FileTypes, omit
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def convert_url_to_file_if_local(
|
|
11
|
+
file: Union[Optional[FileTypes], Omit],
|
|
12
|
+
file_url: Union[Optional[str], Omit],
|
|
13
|
+
) -> Tuple[Union[Optional[FileTypes], Omit], Union[Optional[str], Omit]]:
|
|
14
|
+
"""
|
|
15
|
+
Convert a URL parameter to a file parameter if it's a local file path.
|
|
16
|
+
|
|
17
|
+
If the file_url is a local file path that exists, it will be converted to a Path object
|
|
18
|
+
and returned as the file parameter, with the file_url parameter set to omit.
|
|
19
|
+
|
|
20
|
+
If the file_url is a remote URL (http/https) or doesn't exist as a local file,
|
|
21
|
+
it will be returned unchanged.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
file: The existing file parameter
|
|
25
|
+
file_url: The URL parameter that might be a local file path
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
A tuple of (file, file_url) where one will be set and the other omit
|
|
29
|
+
"""
|
|
30
|
+
# If file_url is omit or None, return unchanged
|
|
31
|
+
if file_url is omit or file_url is None:
|
|
32
|
+
return file, file_url
|
|
33
|
+
|
|
34
|
+
# At this point, file_url is guaranteed to be a string, use cast for type narrowing
|
|
35
|
+
url_str = cast(str, file_url)
|
|
36
|
+
|
|
37
|
+
# Check if it's a remote URL (http/https)
|
|
38
|
+
parsed = urlparse(url_str)
|
|
39
|
+
if parsed.scheme in ("http", "https", "ftp", "ftps"):
|
|
40
|
+
# It's a remote URL, keep it as is
|
|
41
|
+
return file, file_url
|
|
42
|
+
|
|
43
|
+
# Check if it's a local file path
|
|
44
|
+
path = Path(url_str)
|
|
45
|
+
if path.exists() and path.is_file():
|
|
46
|
+
# It's a local file, convert to file parameter
|
|
47
|
+
return path, omit
|
|
48
|
+
|
|
49
|
+
# Path doesn't exist or is not a file, treat as URL
|
|
50
|
+
# (could be a URL with a different scheme or a typo)
|
|
51
|
+
return file, file_url
|
|
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
|
|
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
|
{landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/client_extract_params.py
RENAMED
|
File without changes
|
{landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/client_parse_params.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
|