{"id":24013,"library":"mastercard-places","title":"Mastercard Places Python SDK","description":"Official Mastercard Places API Python SDK. Provides access to Mastercard Places services. Version 1.0.6 (latest). Low release cadence.","status":"active","version":"1.0.6","language":"python","source_language":"en","source_url":"https://github.com/Mastercard/places-api-python-sdk","tags":["mastercard","places","api","sdk"],"install":[{"cmd":"pip install mastercard-places","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core SDK utilities (authentication, API client)","package":"mastercard-core","optional":false}],"imports":[{"note":"Older docs or examples might have a deeper module path; direct import is correct.","wrong":"from mastercard_places.places import PlacesApi","symbol":"PlacesApi","correct":"from mastercard_places import PlacesApi"},{"note":"ApiClient is exported from the package root.","wrong":"from mastercard_places.api_client import ApiClient","symbol":"ApiClient","correct":"from mastercard_places import ApiClient"},{"note":"Configuration is also exported from root.","wrong":"from mastercard_places.configuration import Configuration","symbol":"Configuration","correct":"from mastercard_places import Configuration"}],"quickstart":{"code":"from mastercard_places import Configuration, ApiClient, PlacesApi\n\nconfig = Configuration(\n    consumer_key=os.environ.get('CONSUMER_KEY', ''),\n    keystore_path=os.environ.get('KEYSTORE_PATH', ''),\n    keystore_password=os.environ.get('KEYSTORE_PASSWORD', ''),\n    key_alias=os.environ.get('KEY_ALIAS', ''),\n    host='https://api.mastercard.com')\n\nclient = ApiClient(config)\napi = PlacesApi(client)\nresponse = api.get_place_categories()\nprint(response)","lang":"python","description":"Initialize configuration with credentials from environment variables and call an API."},"warnings":[{"fix":"Use correct keystore file and password. Validate keystore path.","message":"The SDK assumes you are using a Mastercard developer account with valid PKCS12 keystore. Missing or malformed keystore leads to authentication failures.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use try/except or check response.get('status') or use the SDK's error handling utilities (if any).","message":"All API methods return raw dict or objects; errors are not raised as exceptions by default. Must check response status.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install mastercard-places directly without manually installing mastercard-core; let pip resolve.","message":"The SDK requires mastercard-core as a dependency but does not always pin a version. Conflicts can arise if installed separately.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure you have installed mastercard-places and are using import mastercard_places (with underscore).","cause":"Package name is mastercard-places, but import uses underscores.","error":"ModuleNotFoundError: No module named 'mastercard_places'"},{"fix":"Check your Mastercard developer credentials. Ensure environment variables are set correctly.","cause":"Invalid or missing authentication credentials (consumer key, keystore, etc.).","error":"mastercard_places.exceptions.ApiException: (401) Unauthorized"},{"fix":"Set KEYSTORE_PATH to the correct absolute path of the .p12 file and verify it exists.","cause":"The keystore file path is invalid or the file cannot be read.","error":"AttributeError: 'NoneType' object has no attribute 'read'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}