API Reference
Questionary
A Python library for building interactive command-line prompts with validation and styled questions.
Official Documentation ↗CompatibilityThis documentation covers version
v2.0. Check the official docs for the latest API surface.Installation
pip
pip install questionaryMethods
No methods match this filter.
Questionary provides prompt factories for text, selection, confirmation, and passwords.
Key Features
- Text, select, confirm, and password prompts
- Input validation before accepting
- Composable question sequences
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
FAQ
- What does ask() return?
- The answer, or None when the user cancels with Ctrl-C, so check for None before continuing.
- How do I validate answers?
- Attach a validate callable returning True or an error message; invalid input is rejected before the answer is accepted.
- Can I ask several questions at once?
- Yes. Pass a list of questions to questionary.prompt() to run them in sequence and collect a dict of answers.
Report a problem with this API docOpens a pre-filled issue on GitHub.