landingai-ade 0.11.0__tar.gz → 0.12.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.
- landingai_ade-0.12.0/.release-please-manifest.json +3 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/CHANGELOG.md +12 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/PKG-INFO +2 -3
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/README.md +1 -2
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/pyproject.toml +1 -1
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_client.py +13 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_version.py +1 -1
- landingai_ade-0.12.0/src/landingai_ade/lib/url_utils.py +51 -0
- landingai_ade-0.11.0/.release-please-manifest.json +0 -3
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/.gitignore +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/CONTRIBUTING.md +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/LICENSE +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/SECURITY.md +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/api.md +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/bin/check-release-environment +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/bin/publish-pypi +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/examples/.keep +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/noxfile.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/release-please-config.json +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/requirements-dev.lock +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/requirements.lock +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/__init__.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_base_client.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_compat.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_constants.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_exceptions.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_files.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_models.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_qs.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_resource.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_response.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_streaming.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_types.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/__init__.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_compat.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_datetime_parse.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_logs.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_proxy.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_reflection.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_resources_proxy.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_streams.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_sync.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_transform.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_typing.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/_utils/_utils.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/lib/.keep +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/lib/__init__.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/lib/schema_utils.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/py.typed +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/resources/__init__.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/types/__init__.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/types/client_extract_params.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/types/client_parse_params.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/types/extract_response.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/src/landingai_ade/types/parse_response.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/__init__.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/api_resources/__init__.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/api_resources/test_client.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/conftest.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/sample_file.txt +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_client.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_deepcopy.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_extract_files.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_files.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_models.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_qs.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_required_args.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_response.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_streaming.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_transform.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_utils/test_proxy.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/test_utils/test_typing.py +0 -0
- {landingai_ade-0.11.0 → landingai_ade-0.12.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.0 (2025-09-25)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.11.1...v0.12.0](https://github.com/landing-ai/ade-python/compare/v0.11.1...v0.12.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* 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))
|
|
10
|
+
|
|
11
|
+
## 0.11.1 (2025-09-25)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.11.0...v0.11.1](https://github.com/landing-ai/ade-python/compare/v0.11.0...v0.11.1)
|
|
14
|
+
|
|
3
15
|
## 0.11.0 (2025-09-25)
|
|
4
16
|
|
|
5
17
|
Full Changelog: [v0.10.0...v0.11.0](https://github.com/landing-ai/ade-python/compare/v0.10.0...v0.11.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: landingai-ade
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.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
|
|
@@ -101,9 +101,8 @@ class Person(BaseModel):
|
|
|
101
101
|
|
|
102
102
|
# Convert to JSON schema
|
|
103
103
|
schema = pydantic_to_json_schema(Person)
|
|
104
|
-
|
|
105
104
|
# Use with the SDK
|
|
106
|
-
client = LandingAIADE(apikey="VISION_AGENT_API_KEY")
|
|
105
|
+
client = LandingAIADE(apikey=os.environ.get("VISION_AGENT_API_KEY"))
|
|
107
106
|
response = client.extract(
|
|
108
107
|
schema=schema,
|
|
109
108
|
# support markdown or markdown_url
|
|
@@ -66,9 +66,8 @@ class Person(BaseModel):
|
|
|
66
66
|
|
|
67
67
|
# Convert to JSON schema
|
|
68
68
|
schema = pydantic_to_json_schema(Person)
|
|
69
|
-
|
|
70
69
|
# Use with the SDK
|
|
71
|
-
client = LandingAIADE(apikey="VISION_AGENT_API_KEY")
|
|
70
|
+
client = LandingAIADE(apikey=os.environ.get("VISION_AGENT_API_KEY"))
|
|
72
71
|
response = client.extract(
|
|
73
72
|
schema=schema,
|
|
74
73
|
# support markdown or markdown_url
|
|
@@ -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.0 → landingai_ade-0.12.0}/src/landingai_ade/types/client_extract_params.py
RENAMED
|
File without changes
|
{landingai_ade-0.11.0 → landingai_ade-0.12.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
|