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.

Files changed (74) hide show
  1. landingai_ade-0.13.0/.release-please-manifest.json +3 -0
  2. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/CHANGELOG.md +16 -0
  3. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/PKG-INFO +4 -4
  4. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/README.md +3 -3
  5. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/pyproject.toml +1 -1
  6. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_client.py +13 -0
  7. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_version.py +1 -1
  8. landingai_ade-0.13.0/src/landingai_ade/lib/url_utils.py +51 -0
  9. landingai_ade-0.11.1/.release-please-manifest.json +0 -3
  10. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/.gitignore +0 -0
  11. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/CONTRIBUTING.md +0 -0
  12. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/LICENSE +0 -0
  13. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/SECURITY.md +0 -0
  14. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/api.md +0 -0
  15. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/bin/check-release-environment +0 -0
  16. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/bin/publish-pypi +0 -0
  17. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/examples/.keep +0 -0
  18. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/noxfile.py +0 -0
  19. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/release-please-config.json +0 -0
  20. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/requirements-dev.lock +0 -0
  21. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/requirements.lock +0 -0
  22. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/__init__.py +0 -0
  23. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_base_client.py +0 -0
  24. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_compat.py +0 -0
  25. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_constants.py +0 -0
  26. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_exceptions.py +0 -0
  27. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_files.py +0 -0
  28. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_models.py +0 -0
  29. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_qs.py +0 -0
  30. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_resource.py +0 -0
  31. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_response.py +0 -0
  32. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_streaming.py +0 -0
  33. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_types.py +0 -0
  34. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/__init__.py +0 -0
  35. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_compat.py +0 -0
  36. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_datetime_parse.py +0 -0
  37. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_logs.py +0 -0
  38. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_proxy.py +0 -0
  39. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_reflection.py +0 -0
  40. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_resources_proxy.py +0 -0
  41. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_streams.py +0 -0
  42. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_sync.py +0 -0
  43. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_transform.py +0 -0
  44. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_typing.py +0 -0
  45. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/_utils/_utils.py +0 -0
  46. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/lib/.keep +0 -0
  47. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/lib/__init__.py +0 -0
  48. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/lib/schema_utils.py +0 -0
  49. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/py.typed +0 -0
  50. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/resources/__init__.py +0 -0
  51. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/__init__.py +0 -0
  52. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/client_extract_params.py +0 -0
  53. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/client_parse_params.py +0 -0
  54. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/extract_response.py +0 -0
  55. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/src/landingai_ade/types/parse_response.py +0 -0
  56. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/__init__.py +0 -0
  57. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/api_resources/__init__.py +0 -0
  58. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/api_resources/test_client.py +0 -0
  59. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/conftest.py +0 -0
  60. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/sample_file.txt +0 -0
  61. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_client.py +0 -0
  62. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_deepcopy.py +0 -0
  63. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_extract_files.py +0 -0
  64. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_files.py +0 -0
  65. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_models.py +0 -0
  66. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_qs.py +0 -0
  67. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_required_args.py +0 -0
  68. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_response.py +0 -0
  69. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_streaming.py +0 -0
  70. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_transform.py +0 -0
  71. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_utils/test_datetime_parse.py +0 -0
  72. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_utils/test_proxy.py +0 -0
  73. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/test_utils/test_typing.py +0 -0
  74. {landingai_ade-0.11.1 → landingai_ade-0.13.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.13.0"
3
+ }
@@ -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.11.1
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="https://va.landing.ai/pdfs/LabReport.pdf",
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="https://va.landing.ai/pdfs/LabReport.pdf",
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="https://va.landing.ai/pdfs/LabReport.pdf",
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="https://va.landing.ai/pdfs/LabReport.pdf",
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="https://va.landing.ai/pdfs/LabReport.pdf",
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="https://va.landing.ai/pdfs/LabReport.pdf",
132
+ document_url="path/to/file",
133
133
  model="dpt-2-latest",
134
134
  )
135
135
  print(response.chunks)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "landingai-ade"
3
- version = "0.11.1"
3
+ version = "0.13.0"
4
4
  description = "The official Python library for the landingai-ade API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -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,
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "landingai_ade"
4
- __version__ = "0.11.1" # x-release-please-version
4
+ __version__ = "0.13.0" # x-release-please-version
@@ -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
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.11.1"
3
- }
File without changes
File without changes