Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tamber API Client for Python

You can sign up for a Tamber account at https://tamber.com.

For full API documentation, refer to https://tamber.com/docs/api.

Installation

pip install --upgrade tamber

or

easy_install --upgrade tamber

See http://www.pip-installer.org/en/latest/index.html for instructions on installing pip. If you are on a system with easy_install but not pip, you can use easy_install instead. If you're not using virtualenv, you may have to prefix those commands with sudo. You can learn more about virtualenv at http://www.virtualenv.org/

Compatibility

We are compatible with Python 2.6+, Python 3.1+ and PyPy

Usage

Track Events in real time:

import tamber

tamber.project_key = 'Mu6DUPXdDYe98cv5JIfX'

try:
    event = tamber.Event.track(
        user='user_rlox8k927z7p',
        behavior='like',
        item='item_wmt4fn6o4zlk'
    )
    print event
except tamber.TamberError as err:
    print err

Get recommendations:

try:
    recs = tamber.Discover.recommended(
        user='user_rlox8k927z7p',
    )
    for rec in recs:
        print "item:%s  score%s\n" % (rec['item'], rec['score'])
        
except tamber.TamberError as err:
    print err

Timeout Configuration

Timeouts are configurable:

tamber.timeout = 0.7  # timeout is in seconds

try:
    tamber.Event.track(
        user='user_rlox8k927z7p',
        behavior='like',
        item='item_wmt4fn6o4zlk'
    )
except tamber.TamberError as err:
    if err.is_timed_out_error:
        # handle timeout

See test.py for more examples.

About

Tamber API Client for Python

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages