Skip to main content

A library that contains core logic and utilities for consuming REST APIs using Python SDKs generated by APIMatic.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apimatic_core-0.2.24.tar.gz (121.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apimatic_core-0.2.24-py3-none-any.whl (179.8 kB view details)

Uploaded Python 3

File details

Details for the file apimatic_core-0.2.24.tar.gz.

File metadata

  • Download URL: apimatic_core-0.2.24.tar.gz
  • Upload date:
  • Size: 121.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for apimatic_core-0.2.24.tar.gz
Algorithm Hash digest
SHA256 ceb79485da5a75d5ac5303cebad89b1ac4166f75bb30c860ab3b82a8e944d007
MD5 5e1dfe7766b39e26feca6cad1ce9740d
BLAKE2b-256 c432147d4220e66142e44f99c75db3d624f2b8ab16493ccf16f306efec446d24

See more details on using hashes here.

File details

Details for the file apimatic_core-0.2.24-py3-none-any.whl.

File metadata

  • Download URL: apimatic_core-0.2.24-py3-none-any.whl
  • Upload date:
  • Size: 179.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for apimatic_core-0.2.24-py3-none-any.whl
Algorithm Hash digest
SHA256 9e8b965973aff0626897f154beb818f253496c1b8dc9d529f6670726486cf16e
MD5 7e8de057f8eb1a929957b8528bdffae9
BLAKE2b-256 3af7da91aa21989f44feb3dccbb8ef5774e69ae9af74722185668e03c4d30ea4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page