Install & Compatibility
Where this runs
tested against v1.4.12 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 43.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.3s · import 0.000s · 44MB
42MB installed
● package 42MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ApiConfig
✓ from mastercard_api_core import ApiConfig
✗ from mastercard.api import ApiConfig
The correct package name is mastercard_api_core (with underscores), not mastercard.api.
MasterCardApi
✓ from mastercard_api_core import MasterCardApi
Initialize the SDK with a configuration object from environment variables and make an authenticated GET request.
import os
from mastercard_api_core import ApiConfig, MasterCardApi
config = ApiConfig(
consumer_key=os.environ.get('MASTERCARD_CONSUMER_KEY', ''),
key_file_path=os.environ.get('MASTERCARD_KEY_FILE_PATH', ''),
p12_path=os.environ.get('MASTERCARD_P12_PATH', '')
)
api = MasterCardApi(config)
# Example: get a resource (generic, adjust per API)
response = api.get('/api/v1/resource')
print(response.status_code, response.json())
Upgrade
Version history
1.4.12latest on PyPI · released Jan 31, 2018
Audit
Dependencies
requestsrequiredHTTP library used for API calls
pycryptodomexrequiredCryptographic operations (OpenSSL wrapper)