Coder Social home page Coder Social logo

py-kissmetrics's Introduction

py-KISSmetrics

Build Status Coverage Status

KISSmetrics tracking API wrapper for Python

Support for:

  • Python 3.5, 3.6

Also tested against:

  • PyPy (Generally the latest release)

Documentation: http://py-kissmetrics.readthedocs.org

Using this library

>>> import KISSmetrics
>>> KM = KISSmetrics.Client(key='mySuperSecretApiKey')
>>> KM.record('[email protected]', 'Viewed Homepage')
<urllib3.response.HTTPResponse object at 0x...>
>>> KM.record('[email protected]', 'Signed Up', {'Plan' : 'Pro', 'Amount' : 99.95})
<urllib3.response.HTTPResponse object at 0x...>
>>> KM.record('[email protected]', 'Signed Up', timestamp=1234567890)
<urllib3.response.HTTPResponse object at 0x...>
>>> KM.set('[email protected]', {'gender': 'male'})
<urllib3.response.HTTPResponse object at 0x...>

Compatibility client

A compatibility client is provided which is intended to act like the previous generation of Python library here

This interface is provided for compatibility only, and will not be supported in the future.

Example Usage

>>> from KISSmetrics import KM
>>> km = KM("this is your API key")
>>> km.key
'this is your API key'
>>> km.identify('[email protected]')
>>> km.identity
'[email protected]'
>>> km.check_id_key() # this will throw exception if key or identity is None
>>> km.record('Viewed Homepage')
>>> km.record('Signed Up', {'Plan' : 'Pro', 'Amount' : 99.95})
>>> km.record('Signed Up', {'_d' : 1, '_t' : 1234567890})
>>> km.set({'gender' : 'male'})

Development setup

git clone https://github.com/kissmetrics/py-KISSmetrics.git
cd py-KISSmetrics
virtualenv env
source env/bin/activate
pip install -r test-requirements.txt
py.test

Running Tests

If you'd like to run tests against all of our declared supported Pythons, you can do so using tox

pip install tox
tox

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.