Create a Custom Feed on the Setup page to generate server-to-server API credentials.
Install the Python SDK via pip:
pip install git+https://github.com/mparticle/mparticle-python-sdk.git
Integrate mParticle in your Python application.
import mparticle
from mparticle import AppEvent, SessionStartEvent, SessionEndEvent, Batch
batch = Batch()
batch.environment = 'development'
app_event = AppEvent('Hello World', 'navigation')
batch.events = [SessionStartEvent(), app_event, SessionEndEvent()]
configuration = mparticle.Configuration()
configuration.api_key = 'YOUR_API_KEY'
configuration.api_secret = 'YOUR_API_SECRET'
api_instance = mparticle.EventsApi(configuration)
api_instance.upload_events(batch)
Go to the Live Stream and watch new events come in as you run your script.
Congrats on sending your first event to mParticle!
Some ideas on what to do next:
Was this page helpful?