Skip to content

feat: add aiohttp support, connection-error retries, and type docstrings - #31

Closed
fern-api[bot] wants to merge 1 commit into
mainfrom
fern-bot/2026-04-13T21-53Z
Closed

fern-api[bot] wants to merge 1 commit into
mainfrom
fern-bot/2026-04-13T21-53Z

Conversation

@fern-api

@fern-api fern-api Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Version Bump: New public capabilities added: DefaultAioHttpClient, DefaultAsyncHttpxClient, encode_path_param, base_max_retries constructor parameter, and connection-error retry behavior — all backward-compatible additions.

The SDK now supports an optional aiohttp transport backend for async clients. Install it with pip install newscatcher-sdk[aiohttp] and use the new DefaultAioHttpClient class as the httpx_client argument, or let the SDK select it automatically when the extra is present. Two new public client classes are available: DefaultAioHttpClient and DefaultAsyncHttpxClient. The async and sync HTTP clients now also automatically retry on connection-level errors (ConnectError, RemoteProtocolError) using the same exponential-backoff strategy as HTTP 5xx retries. Additionally, encode_path_param is now exported from newscatcher.core for correct URL path encoding of boolean values.

Introduces optional aiohttp transport backend for async clients, automatic
retry logic on connection-level errors, and comprehensive docstrings across
all public type aliases. Also drops Python 3.8/3.9 support and pins
pydantic-core to <2.44.0.

Key changes:
- Add `DefaultAioHttpClient` and `DefaultAsyncHttpxClient` as new public
  classes; install via `pip install newscatcher-sdk[aiohttp]`
- Retry `httpx.ConnectError` and `httpx.RemoteProtocolError` with exponential
  backoff (in addition to existing HTTP-status-based retries)
- Expose `base_max_retries` on `HttpClient` / `AsyncHttpClient` constructors
  so callers can override the default of 2 at the client level
- Add `encode_path_param` helper to `newscatcher.core` for correct
  boolean-to-lowercase-string URL path encoding
- Add `_make_default_async_client` factory that transparently prefers
  `httpx_aiohttp` when the optional extra is installed
- Add rich docstrings to all public type aliases (Q, Theme, SearchIn, etc.)
- Drop Python 3.8 and 3.9 classifier / dependency constraint (minimum is now 3.10)
- Pin `pydantic-core` to `>=2.18.2,<2.44.0` in both pyproject.toml and requirements.txt

🌿 Generated with Fern
@oscatcher oscatcher closed this Apr 23, 2026
@oscatcher
oscatcher deleted the fern-bot/2026-04-13T21-53Z branch May 1, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant