Skip to main content

Python API Client for Localytics Raw Data Export

Project description

Python Client for Localytics Raw Data Export

This is a Python API Client for Localytics Raw Data Export. It allows to export all events and sessions captured by Localytics. Data is written in JSON and available on hourly basis as log files.

Installation

The client is currently best installed via Pypi:

    $ pip install localytics

Usage

Let's have a walk through the functionalities through a couple of examples. Start by loading the library.

    >>> from localytics import Localytics

Setup and Authentication

In order for you to access the KPI Service, you need to authenticate with api_key. Your api_secret, once you supply it, will be used throughout the entire session.

    >>> localytics = Localytics(api_key = 'XXXXX', api_secret= 'YYYYY')

Download Data

There is a method download_data that downloads data to local folder. Example shows how to export data for last 2 days:

    >>> localytics.download_data(
            app_ids = ['AAAAA', 'BBBBB'],
            start_date = datetime.today() - timedelta(2),
            end_date = datetime.today()
        )

You can also specify optional parameters. This is more complex example:

    >>> localytics.download_data(
        app_ids = ['AAAAA', 'BBBBB'],
        start_date = datetime.today() - timedelta(2),
        end_date = datetime.today(),
        destination_folder = 'data',
        compressed=True
    )

On default data are stored in localytics_data folder and compressed in gz format. Please set compresses = True if you want to store data decompressed.

Contributions and bug reports.

Contributions and bug reports are only acceptable as GitHub Pull Requests and issues. Thanks!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localytics-1.42.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

localytics-1.42-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page