import questionary questionary.text("What's your first name").ask() questionary.password("What's your secret?").ask() questionary.confirm("Are you amazed?").ask() questionary.select( "What do you want to do?", choices=["Order a pizza", "Make a reservation", "Ask for opening hours"], ).ask() questionary.rawselect( "What do you want to do?", choices=["Order a pizza", "Make a reservation", "Ask for opening hours"], ).ask() questionary.checkbox( "Select toppings", choices=["foo", "bar", "bazz"] ).ask() questionary.path("Path to the projects version file").ask()
Used and supported by
Questionary supports the following input prompts:
There is also a helper to print formatted text for when you want to spice up your printed messages a bit.
Use the package manager pip to install Questionary:
$ pip install questionary ✨🎂✨
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
That's all it takes to create a prompt! Have a look at the documentation for some more examples.
Documentation for Questionary is available here.
Contributions are very much welcomed and appreciated. Head over to the documentation on how to contribute.
Authors and Acknowledgment
Questionary is written and maintained by Tom Bocklisch and Kian Cross.
Licensed under the MIT License. Copyright 2021 Tom Bocklisch.