Python client for Sixpack, an A/B testing framework under active development at SeatGeek
Project description
Python client library for SeatGeak’s Sixpack ab testing framework.
Installation
First install in your virtual environment:
$ pip install sixpack-client
Usage
Basic example:
from sixpack.sixpack import Session session = Session() # Participate in a test (creates the test if necessary) session.participate("new-test", ["alternative-1", "alternative-2"]) # Convert session.convert("new-test")
Each session has a client_id associated with it that must be preserved across requests. Here’s what the first request might look like:
session = Session session.participate("new-test", ["alternative-1", "alternative-2"]) set_cookie_in_your_web_framework("sixpack-id", session.client_id)
For future requests, create the Session using the client_id stored in the cookie:
client_id = get_cookie_from_web_framework("sixpack-id") session = Session(client_id=client_id) session.convert("new-test")
If you already have a client_id (you can generate one using sixpack.generate_client_id()) you can use the participate() and convert() methods to avoid instantiating a Session yourself. This can help to clean up your logic a bit:
from sixpack.sixpack import participate, convert partipate("new-test", ["alternative-1", "alternative-2"], client_id) convert("new-test", client_id)
Contributing
Fork it
Create your feature branch (git checkout -b my-new-feature)
Commit your changes (git commit -am ‘Added some feature’)
Push to the branch (git push origin my-new-feature)
Create new Pull Request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Sixpack-client-0.3.0.tar.gz
.
File metadata
- Download URL: Sixpack-client-0.3.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1252862177e0fd4e1402591d9c668563dd02247edb03a4e49363f05e4b5d4b8e |
|
MD5 | 3a69ca50516bf388d37b06511a6939e3 |
|
BLAKE2b-256 | c54becb06dc02f321fad59e341c8c39d248f8f00a6429b543602dec54853c860 |