Skip to content

Commit 7f0a898

Browse files
wip initial cut of interface
- Introduces typed sync and async clients for the pdfRest API with configurable base URL, API key (with env var fallback), custom headers, and timeouts. - Adds centralized, library-specific exceptions, translating HTTP layer timeout, transport, and request errors, and wrapping non-2xx API responses with status and message details. - Validates and normalizes requests using internal Pydantic models, including header/param coercion, endpoint shape checks, and timeout handling. - Implements an “up” endpoint method in both clients that returns a validated health/metadata response model. - Updates the package exports to expose clients, request option types, response model, and error helpers. Assisted-by: Codex
1 parent 69d673c commit 7f0a898

5 files changed

Lines changed: 719 additions & 1 deletion

File tree

src/pdfrest/__init__.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,33 @@
22

33
from importlib import metadata
44

5-
__all__ = ("__version__",)
5+
from .client import AsyncPdfRestClient, PdfRestClient, RequestOptions, UpRequestOptions
6+
from .exceptions import (
7+
PdfRestApiError,
8+
PdfRestConfigurationError,
9+
PdfRestError,
10+
PdfRestRequestError,
11+
PdfRestTimeoutError,
12+
PdfRestTransportError,
13+
translate_httpx_error,
14+
)
15+
from .models import UpResponse
16+
17+
__all__ = (
18+
"AsyncPdfRestClient",
19+
"PdfRestApiError",
20+
"PdfRestClient",
21+
"PdfRestConfigurationError",
22+
"PdfRestError",
23+
"PdfRestRequestError",
24+
"PdfRestTimeoutError",
25+
"PdfRestTransportError",
26+
"RequestOptions",
27+
"UpRequestOptions",
28+
"UpResponse",
29+
"__version__",
30+
"translate_httpx_error",
31+
)
632

733
try: # pragma: no cover - fallback should never run in production builds
834
__version__ = metadata.version("pdfrest")

0 commit comments

Comments
 (0)