Repository navigation
feat: add aiohttp support, retry on connection errors, and path param encoding - #30
Closed
fern-api[bot] wants to merge 1 commit into
Closed
fern-api[bot] wants to merge 1 commit into
fern-api[bot] wants to merge 1 commit into
Conversation
… encoding Introduces optional aiohttp transport backend, automatic retry on connection-level errors, and improved URL path parameter encoding. The minimum supported Python version is now 3.10. Key changes: - Add optional `aiohttp` extra (`pip install newscatcher-sdk[aiohttp]`) with `DefaultAioHttpClient` and `DefaultAsyncHttpxClient` helper classes - Automatically retry requests on `httpx.ConnectError` and `httpx.RemoteProtocolError` using exponential backoff with jitter - Introduce `_make_default_async_client` factory that prefers `httpx_aiohttp` when available, falling back to plain `httpx.AsyncClient` - Add `encode_path_param` utility that correctly lowercases Python booleans (`True` → `"true"`) in URL path segments - Add `_retry_timeout_from_retries` helper for backoff when no HTTP response is available - Drop Python 3.8 and 3.9 support; minimum is now Python 3.10 - Pin `pydantic-core` upper bound to `<2.44.0` - Add rich docstring documentation to all public type aliases 🌿 Generated with Fern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version Bump: New capabilities added (aiohttp transport extra, DefaultAioHttpClient/DefaultAsyncHttpxClient classes, connection-error retry behavior, encode_path_param utility) and the minimum Python version was raised from 3.8 to 3.10, which is a behavioral/compatibility change for consumers on older runtimes.
The SDK now supports an optional
aiohttptransport backend for async clients. Install it withpip install newscatcher-sdk[aiohttp]and use the newDefaultAioHttpClientclass as your async HTTP client. Two new convenience classes,DefaultAioHttpClientandDefaultAsyncHttpxClient, are exported from the top-level package with sensible defaults (60 s timeout, redirects enabled). The async and sync HTTP clients now automatically retry requests that fail with connection-level errors (ConnectError,RemoteProtocolError) using exponential backoff, in addition to the existing server-error retry logic. Note: Python 3.8 and 3.9 are no longer supported; the minimum required version is now Python 3.10.