Registry / http-networking / apimatic-requests-client-adapter

apimatic-requests-client-adapter

JSON →
library0.1.10pypypi✓ verified 68d ago

`apimatic-requests-client-adapter` is a Python library that provides an adapter for the popular `requests` HTTP client library. It is specifically designed to be consumed by SDKs generated with APIMatic, allowing them to leverage `requests` for making HTTP calls while integrating APIMatic's configuration, retry logic, and other features. The library is actively maintained with a somewhat irregular but frequent release cadence, and its current version is 0.1.10.

pip install apimatic-requests-client-adapter
INSTALL
IMPORT
SIG · APIMATIC-REQUESTS-
A
apimatic-requests-client-adapter
http-networkingpythonv0.1.10
Install
2.4s avg
Import
617ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.650s · 22.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.4s · import 0.585s · 24MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RequestsClient
from apimatic_requests_client_adapter.requests_client import RequestsClient
from apimatic_requests_client_adapter import RequestsClient
The `RequestsClient` class is located within the `requests_client` submodule, not directly under the top-level package.
RequestsClientConfig
from apimatic_core.request_builders.requests_client_config import RequestsClientConfig
While used by this adapter, `RequestsClientConfig` is part of `apimatic-core`, not this library itself.

This quickstart demonstrates how to instantiate the `RequestsClient` adapter. It involves creating a `RequestsClientConfig` object (from `apimatic-core`) to define HTTP client behavior and optionally a `requests.Session` for advanced session management. The `RequestsClient` instance is then ready to be passed into an APIMatic-generated SDK client.

from requests import Session from apimatic_core.request_builders.requests_client_config import RequestsClientConfig from apimatic_requests_client_adapter.requests_client import RequestsClient # 1. Configure the RequestsClient using RequestsClientConfig # This object defines behaviors like timeouts, retries, and proxy settings. client_config = RequestsClientConfig( timeout=30, max_retries=3, backoff_factor=0.5, retry_status_codes=[408, 413, 429, 500, 502, 503, 504], verify=True, # Proxy support added in v0.1.8+ # proxies={'http': 'http://my.proxy.com:8080', 'https': 'https://my.proxy.com:8080'} ) # 2. Optionally, create a pre-configured requests.Session object. # This allows sharing session state (like cookies) across requests. session = Session() # You could configure the session further here, e.g., session.proxies = {'http': '...', 'https': '...'} # 3. Instantiate the RequestsClient adapter. # This client implements the IHttpClient interface expected by APIMatic SDKs. # If requests_session is not provided, an internal Session is created. # If client_config is not provided, default configurations are used. requests_client_adapter = RequestsClient( requests_client_config=client_config, requests_session=session ) print(f"APIMatic Requests Client Adapter created. Timeout: {requests_client_adapter._requests_client_config.timeout}s") # This adapter is typically passed to an APIMatic-generated SDK client, e.g.: # my_sdk_client = MyAPISDKClient(http_client_instance=requests_client_adapter)
Debug
Known issues
gotchaThis library is primarily an internal component for APIMatic-generated SDKs. While you can instantiate `RequestsClient` directly, its main purpose is to be passed as an `IHttpClient` interface implementation to an SDK client for making API calls. Direct standalone usage for raw HTTP requests is less common; for that, consider using the `requests` library directly.
fix
Ensure you are using the `RequestsClient` as intended, typically by injecting it into an APIMatic-generated SDK client instance.
affects: All versions
deprecatedOlder versions (prior to 0.1.8) lacked first-class proxy support via the `RequestsClientConfig`. While proxies could be configured manually on a `requests.Session` object, direct configuration through the `client_config` was not available.
fix
Upgrade to version 0.1.8 or newer and use the `proxies` dictionary parameter within `RequestsClientConfig` for straightforward proxy setup.
affects: <0.1.8
gotchaPrior to version 0.1.9, injecting an arbitrary custom HTTP client or a pre-configured `requests.Session` directly through a defined interface was less flexible. This could complicate scenarios requiring highly customized HTTP client behavior beyond what `RequestsClientConfig` offered.
fix
Upgrade to version 0.1.9 or newer. This version introduced support for passing a custom `requests.Session` object directly to `RequestsClient` or injecting a custom HTTP client instance via `http_client_instance` in `RequestsClientConfig`.
affects: <0.1.9
breakingAs a 0.x.x version library, minor version updates (e.g., 0.1.x to 0.2.x) can introduce breaking changes without strictly adhering to semantic versioning. Always review the GitHub release notes when updating across minor versions.
fix
Consult the GitHub releases page or changelog for your specific versions before upgrading, paying close attention to any mentioned breaking changes or necessary migration steps.
affects: All 0.x.x versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'apimatic_requests_client_adapter'
The `apimatic-requests-client-adapter` library is not installed in your current Python environment.
fix
Run `pip install apimatic-requests-client-adapter` to install the library.
TypeError: RequestsClientConfig.__init__() got an unexpected keyword argument 'proxies'
You are trying to use a configuration parameter (like `proxies` or `http_client_instance`) that was introduced in a newer version of `apimatic-requests-client-adapter` or `apimatic-core` with an older installed version.
fix
Upgrade both `apimatic-requests-client-adapter` and `apimatic-core` to their latest versions: `pip install --upgrade apimatic-requests-client-adapter apimatic-core`.
ModuleNotFoundError: No module named 'apimatic_core'
The `apimatic-core` library, which provides the `RequestsClientConfig` class essential for configuring `RequestsClient`, is not installed.
fix
Run `pip install apimatic-core` to install the dependency.
AttributeError: 'RequestsClient' object has no attribute 'get'
You are attempting to use the `RequestsClient` adapter directly like a `requests.Session` object to make HTTP requests. `RequestsClient` implements an `IHttpClient` interface and is meant to be passed to an APIMatic-generated SDK client, which then exposes the high-level API methods.
fix
Instantiate an APIMatic-generated SDK client and pass the `RequestsClient` instance to it. If you need raw `requests`-style functionality, use the `requests` library directly.
Upgrade
Version history
0.1.10latest on PyPI · released Nov 27, 2025
Audit
Dependencies
requestsrequiredCore HTTP client library that this package adapts.
apimatic-corerequiredProvides core utilities and configuration classes like `RequestsClientConfig` that are essential for configuring the adapter.
python-dateutilrequiredUsed for date parsing and formatting within APIMatic's ecosystem.
Agent activity
25 hits · last 30 days
node
22
Amazon
2
Resources
apimatic-requests-client-adapter — pip install apimatic-requests-client-adapter · libregistry