Skip to content

AmpliPython is a tool for logging your Amplitude Analytics events easily with Python

License

Notifications You must be signed in to change notification settings

Alveona/AmpliPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AmpliPython

PyPI version GitHub stars

AmpliPython is a Python library which provides an easy method to log your events with Amplitude Analytics.
Built with Pydantic.

Installing

You can install this using pip.

$ pip install AmpliPython

Quick Start

Usage is pretty easy, just pass all the params you want to AmplipyEvent and then log it with AmplipyClient

from amplipython import AmplipyClient, AmplipyEvent

client = AmplipyClient(api_key="YOUR_API_KEY")

# Single event example, no additional data provided
event = AmplipyEvent(user_id="sample", event_type="amplipy-sample")
client.log_event(event)

# Multiple events example with event and user data
event_list = []
for i in range(5):
    event = AmplipyEvent(
        user_id="sample",
        event_type="amplipy-sample",
        event_properties={"iteration": i},
        user_properties={"sent_by": "amplipy"},
    )
    event_list.append(event)

# NOTE: Events order in dashboard is not specified!
client.log_events(event_list)

See all params you can pass to AmplipyEvent instance

Exceptions

When trying to log event, following exceptions could be raised:

  • AmplipyInvalidRequestError

  • AmplipyPayloadTooLargeError

  • AmplipyTooManyRequestsForDeviceError

  • AmplipyAmplitudeServerError

  • AmplipyAmplitudeIsUnavaliable

Event Params

All keys for AmplipyEvent initializer could be found in official Amplitude docs:
https://developers.amplitude.com/docs/http-api-v2


PRs are pretty much welcomed and highly appreciated! 👻

About

AmpliPython is a tool for logging your Amplitude Analytics events easily with Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages