Code Monkey home page Code Monkey logo

mixpanel-query-py's Introduction

mixpanel-query-py

The Python interface to fetch data from Mixpanel via Mixpanel's Data Query API. Note, this differs from the official Python binding which only provides an interface to send data to Mixpanel.

Installation

To install mixpanel-query-py, simply:

$ pip install mixpanel-query-py

or alternatively (you really should be using pip though):

$ easy_install mixpanel-query-py

or from source:

$ git clone [email protected]:cooncesean/mixpanel-query-py.git
$ cd mixpanel-query-py
$ python setup.py install

Usage

You will need a Mixpanel account and your API_KEY + API_SECRET to access your project's data via their API; which can be found in "Account" > "Projects".

from mixpanel_query.client import MixpanelQueryClient
from your_project.conf import MIXPANEL_API_KEY, MIXPANEL_API_SECRET

# Instantiate the client
query_client = MixpanelQueryClient(MIXPANEL_API_KEY, MIXPANEL_API_SECRET)

# Query your project's data
data = query_client.get_events_unique(['Some Event Name'], 'hour', 24)
print data
{
    'data': {
        'series': ['2010-05-29', '2010-05-30', '2010-05-31'],
        'values': {
            'account-page': {'2010-05-30': 1},
            'splash features': {
                '2010-05-29': 6,
                '2010-05-30': 4,
                '2010-05-31': 5,  # Date + unique event counts
            }
        }
    },
    'legend_size': 2
}

View the api reference for details on accessing different endpoints.

API Reference

Mixpanels' full API reference is documented here.

Python Support

This library now supports both by Python >2.7.6 as well as <Python 3.4.3 with recent additions added by @robin900.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.