Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.3.0"
".": "1.4.0"
}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 1.4.0 (2025-12-24)

Full Changelog: [v1.3.0...v1.4.0](https://github.com/landing-ai/ade-python/compare/v1.3.0...v1.4.0)

### Features

* **files:** add support for string alternative to file upload type ([57ae8fb](https://github.com/landing-ai/ade-python/commit/57ae8fb081febb893ee7801836ccd3a725185559))


### Bug Fixes

* use async_to_httpx_files in patch method ([977143a](https://github.com/landing-ai/ade-python/commit/977143a0435f66a04314b92eab54a2145f1776ad))


### Chores

* **internal:** add `--fix` argument to lint script ([caa1bc4](https://github.com/landing-ai/ade-python/commit/caa1bc4030bc88621f898815f3c24060bbc32bf2))
* speedup initial import ([8e2a9f1](https://github.com/landing-ai/ade-python/commit/8e2a9f1b75dc7fca85fab1fb4968ccdd4da204ac))
* speedup initial import ([0b024ed](https://github.com/landing-ai/ade-python/commit/0b024ed6f2ff7fd27cb08ab1e1afeee3b3f842bf))

## 1.3.0 (2025-12-16)

Full Changelog: [v1.2.0...v1.3.0](https://github.com/landing-ai/ade-python/compare/v1.2.0...v1.3.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "landingai-ade"
version = "1.3.0"
version = "1.4.0"
description = "The official Python library for the landingai-ade API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
9 changes: 7 additions & 2 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ set -e

cd "$(dirname "$0")/.."

echo "==> Running lints"
rye run lint
if [ "$1" = "--fix" ]; then
echo "==> Running lints with --fix"
rye run fix:ruff
else
echo "==> Running lints"
rye run lint
fi

echo "==> Making sure it imports"
rye run python -c 'import landingai_ade'
2 changes: 1 addition & 1 deletion src/landingai_ade/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ async def patch(
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
)
return await self.request(cast_to, opts)

Expand Down
95 changes: 71 additions & 24 deletions src/landingai_ade/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
import importlib.metadata
from typing import Any, Dict, Mapping, Iterable, Optional, cast
from typing import TYPE_CHECKING, Any, Dict, Union, Mapping, Iterable, Optional, cast
from typing_extensions import Self, Literal, override

import httpx
Expand Down Expand Up @@ -34,14 +34,14 @@
get_async_library,
async_maybe_transform,
)
from ._compat import cached_property
from ._version import __version__
from ._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .resources import parse_jobs
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, LandingAiadeError
from ._base_client import (
Expand All @@ -55,6 +55,9 @@
from .types.split_response import SplitResponse
from .types.extract_response import ExtractResponse

if TYPE_CHECKING:
from .resources import parse_jobs
from .resources.parse_jobs import ParseJobsResource, AsyncParseJobsResource
_LIB_VERSION = importlib.metadata.version("landingai-ade")

__all__ = [
Expand All @@ -76,10 +79,6 @@


class LandingAIADE(SyncAPIClient):
parse_jobs: parse_jobs.ParseJobsResource
with_raw_response: LandingAIADEWithRawResponse
with_streaming_response: LandingAIADEWithStreamedResponse

# client options
apikey: str

Expand Down Expand Up @@ -158,9 +157,19 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.parse_jobs = parse_jobs.ParseJobsResource(self)
self.with_raw_response = LandingAIADEWithRawResponse(self)
self.with_streaming_response = LandingAIADEWithStreamedResponse(self)
@cached_property
def parse_jobs(self) -> ParseJobsResource:
from .resources.parse_jobs import ParseJobsResource

return ParseJobsResource(self)

@cached_property
def with_raw_response(self) -> LandingAIADEWithRawResponse:
return LandingAIADEWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> LandingAIADEWithStreamedResponse:
return LandingAIADEWithStreamedResponse(self)

@property
@override
Expand Down Expand Up @@ -239,7 +248,7 @@ def extract(
self,
*,
schema: str,
markdown: Optional[FileTypes] | Omit = omit,
markdown: Union[FileTypes, str, None] | Omit = omit,
markdown_url: Optional[str] | Omit = omit,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -396,7 +405,7 @@ def split(
self,
*,
split_class: Iterable[client_split_params.SplitClass],
markdown: Optional[FileTypes] | Omit = omit,
markdown: Union[FileTypes, str, None] | Omit = omit,
markdown_url: Optional[str] | Omit = omit,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -492,10 +501,6 @@ def _make_status_error(


class AsyncLandingAIADE(AsyncAPIClient):
parse_jobs: parse_jobs.AsyncParseJobsResource
with_raw_response: AsyncLandingAIADEWithRawResponse
with_streaming_response: AsyncLandingAIADEWithStreamedResponse

# client options
apikey: str

Expand Down Expand Up @@ -574,9 +579,19 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.parse_jobs = parse_jobs.AsyncParseJobsResource(self)
self.with_raw_response = AsyncLandingAIADEWithRawResponse(self)
self.with_streaming_response = AsyncLandingAIADEWithStreamedResponse(self)
@cached_property
def parse_jobs(self) -> AsyncParseJobsResource:
from .resources.parse_jobs import AsyncParseJobsResource

return AsyncParseJobsResource(self)

@cached_property
def with_raw_response(self) -> AsyncLandingAIADEWithRawResponse:
return AsyncLandingAIADEWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncLandingAIADEWithStreamedResponse:
return AsyncLandingAIADEWithStreamedResponse(self)

@property
@override
Expand Down Expand Up @@ -655,7 +670,7 @@ async def extract(
self,
*,
schema: str,
markdown: Optional[FileTypes] | Omit = omit,
markdown: Union[FileTypes, str, None] | Omit = omit,
markdown_url: Optional[str] | Omit = omit,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -812,7 +827,7 @@ async def split(
self,
*,
split_class: Iterable[client_split_params.SplitClass],
markdown: Optional[FileTypes] | Omit = omit,
markdown: Union[FileTypes, str, None] | Omit = omit,
markdown_url: Optional[str] | Omit = omit,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -908,8 +923,10 @@ def _make_status_error(


class LandingAIADEWithRawResponse:
_client: LandingAIADE

def __init__(self, client: LandingAIADE) -> None:
self.parse_jobs = parse_jobs.ParseJobsResourceWithRawResponse(client.parse_jobs)
self._client = client

self.extract = to_raw_response_wrapper(
client.extract,
Expand All @@ -921,10 +938,18 @@ def __init__(self, client: LandingAIADE) -> None:
client.split,
)

@cached_property
def parse_jobs(self) -> parse_jobs.ParseJobsResourceWithRawResponse:
from .resources.parse_jobs import ParseJobsResourceWithRawResponse

return ParseJobsResourceWithRawResponse(self._client.parse_jobs)


class AsyncLandingAIADEWithRawResponse:
_client: AsyncLandingAIADE

def __init__(self, client: AsyncLandingAIADE) -> None:
self.parse_jobs = parse_jobs.AsyncParseJobsResourceWithRawResponse(client.parse_jobs)
self._client = client

self.extract = async_to_raw_response_wrapper(
client.extract,
Expand All @@ -936,10 +961,18 @@ def __init__(self, client: AsyncLandingAIADE) -> None:
client.split,
)

@cached_property
def parse_jobs(self) -> parse_jobs.AsyncParseJobsResourceWithRawResponse:
from .resources.parse_jobs import AsyncParseJobsResourceWithRawResponse

return AsyncParseJobsResourceWithRawResponse(self._client.parse_jobs)


class LandingAIADEWithStreamedResponse:
_client: LandingAIADE

def __init__(self, client: LandingAIADE) -> None:
self.parse_jobs = parse_jobs.ParseJobsResourceWithStreamingResponse(client.parse_jobs)
self._client = client

self.extract = to_streamed_response_wrapper(
client.extract,
Expand All @@ -951,10 +984,18 @@ def __init__(self, client: LandingAIADE) -> None:
client.split,
)

@cached_property
def parse_jobs(self) -> parse_jobs.ParseJobsResourceWithStreamingResponse:
from .resources.parse_jobs import ParseJobsResourceWithStreamingResponse

return ParseJobsResourceWithStreamingResponse(self._client.parse_jobs)


class AsyncLandingAIADEWithStreamedResponse:
_client: AsyncLandingAIADE

def __init__(self, client: AsyncLandingAIADE) -> None:
self.parse_jobs = parse_jobs.AsyncParseJobsResourceWithStreamingResponse(client.parse_jobs)
self._client = client

self.extract = async_to_streamed_response_wrapper(
client.extract,
Expand All @@ -966,6 +1007,12 @@ def __init__(self, client: AsyncLandingAIADE) -> None:
client.split,
)

@cached_property
def parse_jobs(self) -> parse_jobs.AsyncParseJobsResourceWithStreamingResponse:
from .resources.parse_jobs import AsyncParseJobsResourceWithStreamingResponse

return AsyncParseJobsResourceWithStreamingResponse(self._client.parse_jobs)


Client = LandingAIADE

Expand Down
2 changes: 1 addition & 1 deletion src/landingai_ade/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "landingai_ade"
__version__ = "1.3.0" # x-release-please-version
__version__ = "1.4.0" # x-release-please-version
4 changes: 2 additions & 2 deletions src/landingai_ade/types/client_extract_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing import Union, Optional
from typing_extensions import Required, TypedDict

from .._types import FileTypes
Expand All @@ -19,7 +19,7 @@ class ClientExtractParams(TypedDict, total=False):
the document.
"""

markdown: Optional[FileTypes]
markdown: Union[FileTypes, str, None]
"""The Markdown file or Markdown content to extract data from."""

markdown_url: Optional[str]
Expand Down
4 changes: 2 additions & 2 deletions src/landingai_ade/types/client_split_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Iterable, Optional
from typing import Union, Iterable, Optional
from typing_extensions import Required, Annotated, TypedDict

from .._types import FileTypes
Expand All @@ -18,7 +18,7 @@ class ClientSplitParams(TypedDict, total=False):
Can be provided as JSON string in form data.
"""

markdown: Optional[FileTypes]
markdown: Union[FileTypes, str, None]
"""The Markdown file or Markdown content to split."""

markdown_url: Annotated[Optional[str], PropertyInfo(alias="markdownUrl")]
Expand Down