Skip to main content

A lightweight Python interface for annotating things.

Project description

Questioner Documentation Status

A human-friendly Python library for asking people questions on the command-line.


Data often needs a human eye. I found myself writing over and over the code to help me investigate data manually on the command-line; questioner is my attempt to make this tool the right way once.

It’s suitable for:

  • Labelling data manually faster than you can in excel spreadsheets or similar setups
  • Active learning loops where you and a machine-learnining agent collaborate, reducing the need for training data
  • Short question-based UIs on the command-line where you need a user’s input to continue


Python API

You write a simple Python api that asks you things.

import questioner

with questioner.Cli() as c:
    is_hurt = c.yes_or_no('Are you hurt')

    symptom_set = c.choose_many(
        'What symptoms do you have?',
        ['pain', 'nausea', 'anxiety'],

    rating = c.give_an_int(
        'How would you rate this experience (1-5)', 1, 5

    choice = c.choose_one('Which do you like best',
                          ['dogs', 'cats', 'horses'])

On the terminal

When run, the experience on the terminal looks like the following:

$ python -m questioner.demo
Are you hurt? (y/n) n

What symptoms do you have?
  pain? (y/n) y
  nausea? (y/n) n
  anxiety? (y/n) n

How would you rate this experience (1-5)

Which do you like best
  0. dogs
  1. cats
  2. horses

The user can by default skip a question (raising QuestionSkipped) by pressing enter, or quit the entire cli by pressing q (raising QuitCli).


  • Support for boolean, numeric, single-choice and multiple-choice questions
  • Uses single-keystroke input where possible


MIT licensed.


0.1.0 (2019-02-15)

  • First release on PyPI.

Project details

Download files

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

Files for questioner, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size questioner-0.1.0-py2.py3-none-any.whl (6.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size questioner-0.1.0.tar.gz (10.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page