Skip to main content

Sixpack

https://travis-ci.org/seatgeek/sixpack-py.svg

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()
resp = session.participate("new-test", ["alternative-1", "alternative-2"])
set_cookie_in_your_web_framework("sixpack-id", session.client_id)

You can then make decisions in your application based on resp[‘alternative’][‘name’]:

session = Session()
resp = session.participate("new-test", ["alt-1", "alt-2"])
if resp["alternative"]["name"] == "alt-1":
    set_variable_in_view("new-test-alternative", "alt-1")

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")

Sessions can take an optional options dictionary that takes host and timeout as keys. This allows you to customize Sixpack’s location.:

options = {'host': 'http://mysixpacklocation.com'}
session = Session(client_id="123", options=options)

If Sixpack is unreachable or other errors occur, sixpack-py will provide the control alternative.

Contributing

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am ‘Added some feature’)

  4. Push to the branch (git push origin my-new-feature)

  5. Create new Pull Request

Metadata

Release files for Sixpack-client 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Sixpack-client 1.2.0
File Size Uploaded Provenance
Sixpack-client-1.2.0.tar.gz 5.1 kB Without provenance Details

Release files / Sixpack-client-1.2.0.tar.gz

Download URL Sixpack-client-1.2.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd0bb616af15dea5324c39486bae1b66a6a3a7f269b874f5283449a2e23e219f
BLAKE2b-256 checksum
How to use checksums
a868a50c79ee93da1d9122fb97671664176ca20b9ef1c3e47a1860b316e14034
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Sixpack-client 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page