Skip to content

Repository files navigation

apimatic-core

PyPITestsTest CoverageMaintainability RatingVulnerabilitiesLicence

Introduction

The APIMatic Core libraries provide a stable runtime that powers all the functionality of SDKs. This includes functionality like the ability to create HTTP requests, handle responses, apply authentication schemes, convert API responses back to object instances, validate user and server data, and more advanced features like templating and secure signature verification.


Installation

You will need Python 3.7+ to support this package.

pip install apimatic-core

API Call Classes

NameDescription
RequestBuilderA builder class used to build an API Request
APICallA class used to create an API Call object
ResponseHandlerUsed to handle the response returned by the server

Authentication

NameDescription
HeaderAuthHTTP authentication via headers
QueryAuthHTTP authentication via query parameters
AuthGroupSupports grouping of multiple authentication operations
AndLogical AND grouping for multiple authentication types
OrLogical OR grouping for multiple authentication types
SingleRepresents a single authentication type

Configurations

NameDescription
EndpointConfigurationHolds configurations specific to an endpoint
GlobalConfigurationHolds global configuration properties to make a successful API call

Decorators

NameDescription
LazyPropertyDecorator for lazy instantiation

Exceptions

NameDescription
OneOfValidationExceptionThrown on failed validation of oneOf union-type cases
AnyOfValidationExceptionThrown on failed validation of anyOf union-type cases
AuthValidationExceptionThrown when authentication scheme validation fails

Factories

NameDescription
HttpResponseFactoryFactory to create HTTP responses

HTTP Configurations

NameDescription
HttpClientConfigurationA class used for configuring the SDK by a user
ProxySettingsProxySettings encapsulates HTTP proxy configuration for Requests, e.g. address, port and optional basic authentication for HTTP and HTTPS

HTTP

NameDescription
HttpCallBackCallback handler for HTTP lifecycle events
HttpRequestRepresents an HTTP request
ApiResponseWraps an API response
HttpResponseRepresents an HTTP response

Logging Configuration

NameDescription
ApiLoggingConfigurationGlobal logging configuration for API calls
ApiRequestLoggingConfigurationRequest logging configuration
ApiResponseLoggingConfigurationResponse logging configuration

Logger

NameDescription
SdkLoggerLogs requests and responses when logging configuration is provided
NoneSdkLoggerNo-op logger used when logging is disabled
ConsoleLoggerSimple console logger implementation
LoggerFactoryProvides appropriate logger instances based on configuration

Types

NameDescription
SerializationFormatsEnumeration of array serialization formats
DateTimeFormatEnumeration of DateTime formats
ErrorCaseRepresents exception types
FileWrapperWraps files for upload with content-type
ParameterRepresents an API parameter
XmlAttributesRepresents XML parameter metadata
OneOfRepresents OneOf union types
AnyOfRepresents AnyOf union types
LeafTypeRepresents a specific case in a OneOf/AnyOf union

Pagination

NameDescription
CursorPaginationCursor-based pagination helper
LinkPaginationLink-based pagination helper
OffsetPaginationOffset-based pagination helper
PagePaginationPage-number-based pagination helper
PaginatedDataIterable interface to traverse items and pages in a paginated API

Utilities

NameDescription
ApiHelperHelper functions for API calls
AuthHelperHelper functions for authentication
ComparisonHelperUtilities for response comparison
FileHelperFile handling utilities
XmlHelperXML serialization/deserialization helpers
DateTimeHelperDate/time parsing and validation helpers
UnionTypeHelperDeserialization and validation for OneOf/AnyOf union types

Signature Verification

NameDescription
HmacSignatureVerifierVerifies HMAC signatures using configurable templates, hash algorithms, and encoders
HexEncoderEncodes digest as lowercase hex
Base64EncoderEncodes digest as Base64
Base64UrlEncoderEncodes digest as URL-safe Base64 without padding

This layer enables secure handling of webhooks, callbacks, and API integrations that rely on HMAC or other signing strategies.


NameDescription
to_unified_requestSync wrapper for Flask/Django (WSGI). Unwraps Flask LocalProxy when present and bridges to the async converter using an event loop.
to_unified_request_asyncAsync adapter that converts Starlette/FastAPI, Flask/Werkzeug, or Django requests into a framework-agnostic Request snapshot (method, path, url, headers, raw body, query, form, cookies).

Links

About

This project contains core logic and the utilities for the APIMatic's Python SDK

Resources

Contributing

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages