Repository navigation
feat: add aiohttp support, connection-error retries, and type docstrings - #31
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
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
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 public capabilities added:
DefaultAioHttpClient,DefaultAsyncHttpxClient,encode_path_param,base_max_retriesconstructor parameter, and connection-error retry behavior — all backward-compatible additions.The SDK now supports an optional
aiohttptransport backend for async clients. Install it withpip install newscatcher-sdk[aiohttp]and use the newDefaultAioHttpClientclass as thehttpx_clientargument, or let the SDK select it automatically when the extra is present. Two new public client classes are available:DefaultAioHttpClientandDefaultAsyncHttpxClient. 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_paramis now exported fromnewscatcher.corefor correct URL path encoding of boolean values.