Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 921 Bytes

README.md

File metadata and controls

47 lines (30 loc) · 921 Bytes


Onna Logo

Amplitude Client

About

AIOHTTP based wrapper for the Amplitude HTTP V2 API.

Installation

pip install amplitude-client

Usage

from amplitude_client.logger import AmplitudeLogger

import asyncio

logger = AmplitudeLogger(api_key="YOUR_API_KEY")


async def run():
    event_payload = {
        "user_id": "[email protected]",
        "event_type": "Performed some action",
        "event_properties": {"load_time": 0.5},
    }

    await logger.log_event(event=event_payload)


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(run())