Skip to main content

Python API Client for Localytics Raw Data Export and Audience Export

Project description

Python Client for Localytics Raw and Audience Data Export

This is a Python API Client to get data from Localytics Raw Data Export and Localytics Audience Data Export.

It allows to export all events and sessions and user defined audience captured by Localytics. Data is written in JSON (Compressed) and available on hourly basis as log files.

Installation

istall it by pip

    $ pip install pylocalytics

Usage

Start by loading the library and also you need to import timedelta and datetime on most cases.

    >>> from pylocalytics import pyLocalytics
    >>> from datetime import datetime
    >>> from datetime import timedelta

Setup and Authentication

In order for you to download Localytics events, you need to authenticate with using api_key and api_secret. Once you supply it, it will be used throughout the entire session. You can find you API_KEY and API_SECRET_KEY in your Localytics Admin Panel on Admin Setting API Key

    >>> loctx = pylocalytics(api_key = 'YOU_API_KEY', api_secret= 'YOUR_API_SECRET_KEY')

Download Data

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

    >>> loctx.download_data(
            app_ids = ['YOUR_APP_ID'],
            start_date = datetime.today() - timedelta(2),
            end_date = datetime.today()
        )

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

    >>> loctx.download_data(
        app_ids = [YOUR_APP_ID],
        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. IF don't want to store the compressed version and just need Json file, set compressed = False.

Because I'm working on a project which collect our App data from the Localytics and them import them to our Data WareHouse , I'm working on this Library and If I see some global features which is useful for others, I'll add it.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

pylocalytics-1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylocalytics-1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file pylocalytics-1.0.tar.gz.

File metadata

  • Download URL: pylocalytics-1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pylocalytics-1.0.tar.gz
Algorithm Hash digest
SHA256 7cc7ce1fe33dfc9d2381531ca269ca2985f79334016c9d6de8049bbdf1a29384
MD5 d403da39c97da0b69e131b3672ae2d5c
BLAKE2b-256 7860312090b480f05e21018bd49fad4b7f237509777397e4d218e12f24233dd8

See more details on using hashes here.

File details

Details for the file pylocalytics-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylocalytics-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff226fc58a4af649aca69435ea0e6b3411a79bfe9017e6004bb54e74294e19a9
MD5 aaafafd8b2f2efc4718150a6e6459c85
BLAKE2b-256 0abaacacc452b5e42cc7ea18d07de6130536dddfdc8049f08d5485ca888a2374

See more details on using hashes here.

Supported by

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