Python library to build pretty command line user prompts ⭐️
Project description
Questionary
✨ Questionary is a Python library for effortlessly building pretty command line interfaces ✨
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
Features
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.
Installation
Use the package manager pip to install Questionary:
$ pip install questionary
✨🎂✨
Usage
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
Documentation for Questionary is available here.
Support
Please open an issue with enough information for us to reproduce your problem. A minimal, reproducible example would be very helpful.
Contributing
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.
It is based on the great work by Oyetoke Toby and Mark Fink.
License
Licensed under the MIT License. Copyright 2021 Tom Bocklisch.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file questionary-2.0.1.tar.gz
.
File metadata
- Download URL: questionary-2.0.1.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcce898bf3dbb446ff62830c86c5c6fb9a22a54146f0f5597d3da43b10d8fc8b |
|
MD5 | 2ca6f5b8299edbce76a72fb450c3f53e |
|
BLAKE2b-256 | 84d0d73525aeba800df7030ac187d09c59dc40df1c878b4fab8669bdc805535d |
File details
Details for the file questionary-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: questionary-2.0.1-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ab9a01d0b91b68444dff7f6652c1e754105533f083cbe27597c8110ecc230a2 |
|
MD5 | f2b7f9272fa1a54834418bfbd10ce475 |
|
BLAKE2b-256 | 0be72dd8f59d1d328773505f78b85405ddb1cfe74126425d076ce72e65540b8b |