Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

A Python client for Decipher

Project Description


[![Build Status](](

Python client for [Decipher]( data and survey list API.

## Installation

git clone
cd Decipher
pip install .

## Usage

### Create a client

Creating a client requires your decipher username and password.

from decipher.client import Client
c = Client('', 'Pa$$w0rd123')

By default, the client refers to the `` host. Alternate hosts can be specified in the constructor:

c = Client('', 'Pa$$w0rd123', host='')

All hosts are assumed to be over SSL (`https`).

### Retrieve list of available surveys

You can retrieve a list of all surveys in three formats:

- `json`: JavaScript Object Notation
- `csv`: comma-separated values
- `tsv`: tab-separated values


### Pull data for a specific survey

c.get_survey(survey, start=None, end=None, status=None, columns=None, filters=None, fmt='json')

- `survey` is the full survey path
- `start` and `end` are Python datetimes (assumes UTC)
- `columns` is a list of column names to include in the results
- `filters` is a list of column-specific rules
- As above, `fmt` is the return format and can be `json`, `csv`, or `tsv`

### Command-line interface (CLI)

Included with the installation is a command-line utlity called `decipher` with built-in help:

$ decipher --help
usage: decipher [-h] -U USERNAME -P PASSWORD [-H HOST] {pull,list} ...

A command-line utility for interacting with the Decipher API. Help is
available on subcommands (e.g. `decipher pull --help`)

optional arguments:
-h, --help show this help message and exit
user identification
user password
-H HOST, --host HOST host

valid subcommands:
pull pull survey data
list list surveys

#### Get survey data

$ decipher pull --help
usage: decipher pull [-h] -s SURVEY [-t START] [-T END]
[-S {all,partial,complete,qualified,terminated,overquota}]
[-c COLUMNS] [-F FILTERS] [-f {json,tsv,csv}]

optional arguments:
-h, --help show this help message and exit
-s SURVEY, --survey SURVEY
survey name
-t START, --start START
utc start time: YYYY-MM-DDTHH:MM:SS.mmmmmm
-T END, --end END utc end time: YYYY-MM-DDTHH:MM:SS.mmmmmm
-S {all,partial,complete,qualified,terminated,overquota}, --status {all,partial,complete,qualified,terminated,overquota}
survey status
-c COLUMNS, --columns COLUMNS
filter conditions
-f {json,tsv,csv}, --fmt {json,tsv,csv}
return format


$ decipher -U dataapi -P dataapi pull -s 'kbdemo/data' -f csv -S qualified -c uuid,q1 -F 'q1=2'

#### Get list of surveys

$ decipher list --help
usage: decipher list [-h] [-f {json,tsv,csv}]

optional arguments:
-h, --help show this help message and exit
-f {json,tsv,csv}, --fmt {json,tsv,csv}
return format


$ decipher -U dataapi -P dataapi list -f csv

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(4.2 kB) Copy SHA256 Hash SHA256
Source Oct 16, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting