Registry / http-networking / apimatic-core

apimatic-core

JSON →
library0.2.25pypypi✓ verified 86d ago

APIMatic Core is a foundational Python library (v0.2.24) that provides the essential logic and utilities for consuming REST APIs. It's primarily used as a dependency for Python SDKs generated by APIMatic, aiming to offer a consistent and robust developer experience. The library receives frequent minor updates, focusing on new features, bug fixes, and dependency bumps.

pip install apimatic-core
INSTALL
IMPORT
SIG · APIMATIC-CORE
A
apimatic-core
http-networkingpythonv0.2.25
Install
3.1s avg
Import
669ms
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.25 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.712s · 25.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.1s · import 0.626s · 26MB
28MB installed
● package 28MB
Code
Verified usage

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

GlobalConfiguration
from apimatic_core.configurations.global_configuration import GlobalConfiguration
Used to modify global settings for generated SDKs.
ApiException
from apimatic_core.exceptions.api_exception import ApiException
Base exception class for API-specific errors.
ApiHelper
from apimatic_core.utilities.api_helper import ApiHelper
Contains utility functions for API requests and responses.

This quickstart demonstrates how to configure global settings that would be utilized by an APIMatic-generated SDK. It also shows how to catch a generic `ApiException`, a common pattern when working with generated clients.

import os from apimatic_core.configurations.global_configuration import GlobalConfiguration from apimatic_core.http.requests_client.requests_client import RequestsClient # This library is primarily used by generated SDKs. # Direct usage often involves configuring global settings # or handling generic exceptions. # Example: Configure global HTTP client settings GlobalConfiguration.set_timeout(30) # seconds GlobalConfiguration.set_user_agent("MyCustomApp/1.0") GlobalConfiguration.set_verify_ssl(True) # Optionally provide a custom HTTP client instance # GlobalConfiguration.set_http_client(RequestsClient()) print(f"Global API Timeout: {GlobalConfiguration.get_timeout()} seconds") print(f"Global User-Agent: {GlobalConfiguration.get_user_agent()}") print(f"Global SSL Verification: {GlobalConfiguration.get_verify_ssl()}") # In a generated SDK, these settings would now apply. # For example, if you had an SDK generated by APIMatic: # from my_generated_sdk.client import MyClient # client = MyClient() # ... the client would use the configured settings # Example for handling a generic API exception (would typically come from a generated SDK call) try: # Simulate an operation that might raise an ApiException raise ApiException("Resource not found", 404, {'X-Request-ID': 'abc'}) except ApiException as e: print(f"Caught API Exception: {e.message} (Status: {e.response_code})") print(f"Headers: {e.response_headers}")
Debug
Known issues
gotchaAPIMatic Core is primarily an internal library for SDKs generated by APIMatic. While you can import and use its components directly, its main purpose is to provide a consistent base for generated code. If you're not using APIMatic to generate an SDK, you might find more direct HTTP client libraries (like `requests`) more suitable.
fix
Understand that direct usage is for advanced customization or debugging of generated SDKs. For general HTTP client needs, consider `requests`.
affects: All versions
deprecatedOlder versions of Python might not be fully supported. While `apimatic-core` aims for broad compatibility, recent releases (v0.2.18+) explicitly test for Python 3.12 and 3.13. Using significantly older Python versions (e.g., Python 3.7 or earlier) may lead to unexpected issues.
fix
Ensure you are using Python 3.8+ for optimal compatibility. Upgrade to a supported Python version if encountering compatibility errors.
affects: <0.2.18 (potentially)
gotchaModifying `GlobalConfiguration` directly affects *all* subsequent operations that use these global settings within your application's process. Be mindful of potential side effects, especially in multi-threaded environments or if different parts of your application require distinct API configurations.
fix
For highly specific client configurations, consider creating and passing a custom `RequestsClient` instance to the generated SDK's client constructor if supported, rather than relying solely on global settings.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'apimatic_core'
The `apimatic-core` library is not installed in your Python environment.
fix
Run `pip install apimatic-core` to install the library.
from apimatic_core.http.http_client import HttpClient # or similar import fails
Attempting to import an abstract base class or an internal implementation that is not directly exposed or intended for direct instantiation.
fix
Most user-level interactions are with concrete implementations like `RequestsClient` or higher-level abstractions like `GlobalConfiguration` and `ApiException`. Consult the library's source code or a generated SDK's usage for specific concrete classes.
ValueError: Invalid URL: No scheme supplied. Perhaps you meant http://...
Often occurs when the base URL for an API call (usually set by a generated SDK) is misconfigured or missing a scheme (e.g., `http://` or `https://`). `apimatic-core` relies on `requests` which requires a valid URL.
fix
Ensure that the base URL configured for your generated SDK (or passed to any core HTTP client method) includes a valid scheme. Check your SDK's configuration or environment variables.
Upgrade
Version history
0.2.25latest on PyPI · released Jun 8, 2026
Audit
Dependencies
python-dateutilrequiredUtility for date and time parsing.
jsonpicklerequiredSerialization and deserialization of complex Python objects to and from JSON.
requestsrequiredHTTP client for making API calls.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
apimatic-core — pip install apimatic-core · libregistry