Skip to content

apimatic/core-lib-python

Repository files navigation

apimatic-core

PyPI Tests Test Coverage Maintainability Rating Vulnerabilities Licence

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

Name Description
RequestBuilder A builder class used to build an API Request
APICall A class used to create an API Call object
ResponseHandler Used to handle the response returned by the server

Authentication

Name Description
HeaderAuth HTTP authentication via headers
QueryAuth HTTP authentication via query parameters
AuthGroup Supports grouping of multiple authentication operations
And Logical AND grouping for multiple authentication types
Or Logical OR grouping for multiple authentication types
Single Represents a single authentication type

Configurations

Name Description
EndpointConfiguration Holds configurations specific to an endpoint
GlobalConfiguration Holds global configuration properties to make a successful API call

Decorators

Name Description
LazyProperty Decorator for lazy instantiation

Exceptions

Name Description
OneOfValidationException Thrown on failed validation of oneOf union-type cases
AnyOfValidationException Thrown on failed validation of anyOf union-type cases
AuthValidationException Thrown when authentication scheme validation fails

Factories

Name Description
HttpResponseFactory Factory to create HTTP responses

HTTP Configurations

Name Description
HttpClientConfiguration A class used for configuring the SDK by a user
ProxySettings ProxySettings encapsulates HTTP proxy configuration for Requests, e.g. address, port and optional basic authentication for HTTP and HTTPS

HTTP

Name Description
HttpCallBack Callback handler for HTTP lifecycle events
HttpRequest Represents an HTTP request
ApiResponse Wraps an API response
HttpResponse Represents an HTTP response

Logging Configuration

Name Description
ApiLoggingConfiguration Global logging configuration for API calls
ApiRequestLoggingConfiguration Request logging configuration
ApiResponseLoggingConfiguration Response logging configuration

Logger

Name Description
SdkLogger Logs requests and responses when logging configuration is provided
NoneSdkLogger No-op logger used when logging is disabled
ConsoleLogger Simple console logger implementation
LoggerFactory Provides appropriate logger instances based on configuration

Types

Name Description
SerializationFormats Enumeration of array serialization formats
DateTimeFormat Enumeration of DateTime formats
ErrorCase Represents exception types
FileWrapper Wraps files for upload with content-type
Parameter Represents an API parameter
XmlAttributes Represents XML parameter metadata
OneOf Represents OneOf union types
AnyOf Represents AnyOf union types
LeafType Represents a specific case in a OneOf/AnyOf union

Pagination

Name Description
CursorPagination Cursor-based pagination helper
LinkPagination Link-based pagination helper
OffsetPagination Offset-based pagination helper
PagePagination Page-number-based pagination helper
PaginatedData Iterable interface to traverse items and pages in a paginated API

Utilities

Name Description
ApiHelper Helper functions for API calls
AuthHelper Helper functions for authentication
ComparisonHelper Utilities for response comparison
FileHelper File handling utilities
XmlHelper XML serialization/deserialization helpers
DateTimeHelper Date/time parsing and validation helpers
UnionTypeHelper Deserialization and validation for OneOf/AnyOf union types

Signature Verification

Name Description
HmacSignatureVerifier Verifies HMAC signatures using configurable templates, hash algorithms, and encoders
HexEncoder Encodes digest as lowercase hex
Base64Encoder Encodes digest as Base64
Base64UrlEncoder Encodes 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.


Name Description
to_unified_request Sync wrapper for Flask/Django (WSGI). Unwraps Flask LocalProxy when present and bridges to the async converter using an event loop.
to_unified_request_async Async 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

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 10

Languages