{"id":27969,"library":"mparticle","title":"mParticle Python SDK","description":"Python client for the mParticle customer data platform. Currently version 0.16.1. SDK supports event tracking, user management, and consent state. Maintenance cadence is irregular with occasional feature releases.","status":"active","version":"0.16.1","language":"python","source_language":"en","source_url":"https://github.com/mParticle/mparticle-python-sdk","tags":["mParticle","CDP","customer data","analytics","event tracking"],"install":[{"cmd":"pip install mparticle","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"Python 2/3 compatibility","package":"six","optional":false},{"reason":"Date/time parsing","package":"python-dateutil","optional":false}],"imports":[{"note":null,"wrong":null,"symbol":"Batch","correct":"from mparticle import Batch"},{"note":null,"wrong":null,"symbol":"MParticle","correct":"from mparticle import MParticle"},{"note":null,"wrong":null,"symbol":"Event","correct":"from mparticle import Event"},{"note":"UserIdentities is a model in the separate models module, not directly in mparticle top-level","wrong":"from mparticle import UserIdentities","symbol":"UserIdentities","correct":"from mparticle.models import UserIdentities"}],"quickstart":{"code":"from mparticle import MParticle\nfrom mparticle import Event\nfrom mparticle.models import UserIdentities\n\napi_key = os.environ.get('MPARTICLE_API_KEY', '')\napi_secret = os.environ.get('MPARTICLE_API_SECRET', '')\n\nmp = MParticle(api_key, api_secret)\n\n# Track a simple event\nevent = Event('Test Event', 'navigation')\nmp.log_event(event)\n\n# Track with user identity\nuser_ids = UserIdentities(customer_id='user123')\nmp.log_event(event, user_identities=user_ids)","lang":"python","description":"Initialize mParticle client with API credentials and log a custom event."},"warnings":[{"fix":"Watch for API version updates in the official changelog.","message":"The SDK uses v2 of the mParticle Events API, but some endpoints may be removed in future versions.","severity":"deprecated","affected_versions":">=0.10.0,<0.17.0"},{"fix":"Import from mparticle.models instead of mparticle.","message":"UserIdentities moved from top-level to mparticle.models in v0.11.0.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Use mp.upload() with a Batch object to send batched events.","message":"Batch uploads require setting the batch endpoint correctly; default config may not batch as expected.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python 3.5+.","message":"Python 3.5 minimum since v0.13.0; Python 2.7 support dropped.","severity":"deprecated","affected_versions":">=0.13.0"}],"env_vars":null,"search_vec":"'0.16.1':14 'analyt':36 'cadenc':25 'cdp':33 'client':5 'consent':22 'current':12 'custom':9,34 'data':10,35 'event':17,37 'featur':30 'irregular':27 'mainten':24 'manag':20 'mparticl':1,8,32 'occasion':29 'platform':11 'python':2,4 'releas':31 'sdk':3,15 'state':23 'support':16 'track':18,38 'user':19 'version':13","created_at":"2026-05-09T05:53:02.309952+00:00","updated_at":"2026-05-09T05:53:02.309952+00:00","problems":[{"fix":"Use 'from mparticle.models import UserIdentities' instead.","cause":"UserIdentities is in the models submodule, not top-level.","error":"AttributeError: module 'mparticle' has no attribute 'UserIdentities'"},{"fix":"Verify your mParticle API credentials and ensure environment variables are set correctly.","cause":"Invalid API key or secret.","error":"mparticle.exceptions.MParticleError: 401 Unauthorized"},{"fix":"Call 'mp.log_event(event)' with the event as a positional argument.","cause":"Passing event object as keyword argument incorrectly.","error":"TypeError: log_event() missing 1 required positional argument: 'event'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://www.mparticle.com","github":"https://github.com/mParticle/mparticle-python-sdk","docs":null,"changelog":null,"pypi":"https://pypi.org/project/mparticle/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["crm-productivity","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}