CLI tool
tmbo/questionary avatar
tmbo/questionary

Questionary returns None on Ctrl+C and sits on top of prompt_toolkit

Python library to build pretty command line user prompts ✨Easy to use multi-select lists, confirmations, free text prompts ...

2,202 stars123 forksPythonMIT

At a glance

What is it?
tmbo/questionary is a Python library of eight prompt types for command line scripts, built on prompt_toolkit. Each prompt is one call ending in .ask(), and the limits come from that single-question shape.
Who is it for?
Use Questionary when a Python script needs a handful of interactive questions (pick one, pick many, confirm, enter a path) and you want each to be a single call. Skip it for full-screen terminal interfaces or for scripts that run unattended, since every prompt waits on a keyboard.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 98 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 24, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • tmbo/questionary2,202 ★ · +17
Star history
Repository2026-10-082026-11-24
tmbo/questionary2.2k2.2k

17 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Every prompt is one function call ending in .ask()

A Questionary prompt is a function from the questionary module that builds a question object, followed by .ask() to run it. The README shows the shape in a single block:

python
import questionary

questionary.select(
    "What do you want to do?",
    choices=[
        'Order a pizza',
        'Make a reservation',
        'Ask for opening hours'
    ]).ask()  # returns value of selection

The call returns the value of the selection. There is no form object, no event loop to start and no class to subclass. A script that needs a name, a secret and a yes or no answer makes three calls in a row and uses the three return values.

The flip side is that the library has no built-in notion of a whole form. Validation across several answers, or a question that depends on an earlier one, is plain Python in the script around the calls. The examples directory includes dependent_selects.py and advanced_workflow.py for exactly that.

Eight prompt types cover the common cases and nothing more

The feature list names text, password, file path, confirmation, select, raw select, checkbox and autocomplete. A separate helper prints formatted text so messages between questions can match the prompts visually.

In code these map to questionary.text, questionary.password, questionary.path, questionary.confirm, questionary.select, questionary.rawselect, questionary.checkbox and an autocomplete function. The README example calls questionary.path("Path to the projects version file") and questionary.checkbox with a list of three toppings.

What is missing matters to someone choosing a library. There is no date picker, no numeric input type, no table and no progress bar in the list. A number is a text prompt that your code converts and checks. The documentation pages linked from the README describe each type in more detail, and the repository ships example scripts such as text_phone_number.py, which shows text input with validation.

Select, rawselect and checkbox answer different shapes of question

Select shows a list of choices and returns the one you pick. Raw select has the same call signature in the README example, with the same three choices, and the repository has a rawselect_action.py and rawselect_separator.py to show how it differs in use. Checkbox lets several choices be selected and returns them together, and the examples include checkbox_toppings.py, checkbox_search.py and checkbox_separators.py.

Separators appear in both the checkbox and rawselect examples, which signals that long lists can be divided into groups. select_search.py suggests that select prompts can be filtered by typing.

Choosing between these is a user experience decision. A short list of actions suits select. A long list where several items may apply suits checkbox, and the user toggles entries instead of typing. None of the three accepts an answer that is not in the list, so an Other option has to be added as a choice and followed by a text prompt.

prompt_toolkit is the only runtime dependency, with a wide version range

The pyproject.toml declares python >=3.10 and one dependency, prompt_toolkit, at >=2.0,<4.0. Installation is a single pip command:

bash
pip install questionary

The classifiers list Python 3.10 through 3.14 and MIT licensing. The Black configuration targets py310 to py314. A script on Python 3.9 or earlier cannot install the current version at all, because the python constraint excludes it.

The prompt_toolkit range is unusually wide, spanning major versions 2 and 3. Questionary does not pin it, so the version pip picks depends on what else is installed in the environment. If another package in your project holds prompt_toolkit at a specific release, Questionary follows. Behavior differences between prompt_toolkit releases are not described in the README, so test your prompts in the environment you ship.

Used by Rasa, written by two maintainers, and based on two older projects

The README shows a Used and supported by line with a link to RasaHQ/rasa. Authors and maintainers in pyproject.toml are Tom Bocklisch and Kian Cross. The README states that the library builds on the work of Oyetoke Toby (PyInquirer) and Mark Fink (whaaaaat).

That lineage tells a newcomer what the library is for. PyInquirer and whaaaaat were both attempts to bring an Inquirer style question flow to Python, and Questionary continues that idea with prompt_toolkit underneath. The keywords in pyproject.toml include inquirer, cli, ui, questions and prompt.

The project is small. Two named maintainers handle support requests, which the README asks to be opened as issues with a minimal reproducible example. The license text credits Copyright 2021 Tom Bocklisch, while the version in pyproject.toml is 2.1.0 and the Development Status classifier says 4 - Beta.

Maintenance is recent, but there are no GitHub releases to pin to

The repository is not archived. The last push was 2026-08-18, so the project has seen activity within the last few months. No GitHub releases exist, which means version history has to be read from PyPI or from pyproject.toml, where the version is 2.1.0.

Development runs through Poetry. The Makefile has targets for install, develop, lint, test, types and docs, and `make test` runs pytest with coverage over the questionary package. Type checking uses mypy, and pre-commit runs the lint rules. Documentation is built with Sphinx and hosted on Read the Docs.

For a user the consequence is small: pin questionary in your requirements file to a version you tested. For a contributor, the setup is `poetry install --with="docs"` through make install, followed by pre-commit installation through make develop.

Keyboard-driven prompts do not suit unattended scripts

Every prompt waits for a person at a terminal. A script run from cron, a CI job or a pipe has no one to answer, and the README offers no non-interactive mode, no default-answer flag and no way to feed answers from a file. If a tool must work both interactively and unattended, the interactive layer has to be optional in your own code, with arguments or environment variables supplying the same values.

The README also does not document what happens when a user cancels a prompt. The .ask() pattern returns a value on success, and a cancelled question is a path every real script has to handle. Running the matching example from the examples directory and pressing Ctrl+C is the quickest way to see the result before writing code that depends on it.

Editorial conclusion

Use Questionary when a Python script needs a handful of interactive questions (pick one, pick many, confirm, enter a path) and you want each to be a single call. Skip it for full-screen terminal interfaces or for scripts that run unattended, since every prompt waits on a keyboard. Before adopting, run the example closest to your flow from the examples directory and check how it behaves when you press Ctrl+C.

Frequently asked questions

What is the difference between questionnaire and questionary, as in tmbo/questionary?

This repository is the Python library named Questionary, used to build command line prompts. Its README does not discuss the word questionnaire.

Questionary vs questionnaire: which is the Python library?

Questionary is the Python library for building command line interfaces, installed with pip install questionary. It offers text, password, path, confirm, select, rawselect, checkbox and autocomplete prompts.

Is there a Python questionary alternative?

The README names no alternatives. It says Questionary is based on PyInquirer by Oyetoke Toby and whaaaaat by Mark Fink, and it is built on prompt_toolkit.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. tmbo/questionary on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tmbo-questionary.svg)](https://hysenlabs.com/projects/tmbo-questionary)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/tmbo-questionary.svg)](https://hysenlabs.com/projects/tmbo-questionary)

Was this useful?