Registry / crm-productivity / inquirerpy

inquirerpy

JSON →
library0.3.4pypypi✓ verified 23d ago

InquirerPy is a Python port of the famous Inquirer.js, offering a collection of common interactive command-line user interfaces. It is a re-implementation of the PyInquirer project, focusing on bug fixes, new prompts, backward-compatible APIs, and enhanced customization. Currently at version 0.3.4, the library maintains an active development and release cadence.

pip install InquirerPy
INSTALL
IMPORT
SIG · INQUIRERPY
I
inquirerpy
crm-productivitypythonv0.3.4
Install
2.2s avg
Import
673ms
Disk
25MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.700s · 28.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.646s · 29MB
25MB installed
● package 25MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

inquirer
from InquirerPy import inquirer
Recommended 'Alternate Syntax' for direct interaction with prompt classes.
prompt
from InquirerPy import prompt
Used for 'Classic Syntax' (PyInquirer compatible), taking a list of questions.
Validator
from InquirerPy.validator import Validator
from InquirerPy import Validator
Validator classes (e.g., NumberValidator, PathValidator) are within the 'validator' submodule.

This quickstart demonstrates the recommended 'Alternate Syntax' to create and execute common interactive prompts like text input, single-choice selection, and confirmation. The `.execute()` method runs the prompt and returns the user's input.

from InquirerPy import inquirer name = inquirer.text(message="What's your name:").execute() fav_lang = inquirer.select( message="What's your favourite programming language:", choices=["Go", "Python", "Rust", "JavaScript"], ).execute() confirm = inquirer.confirm(message="Confirm?").execute() print(f"Hello {name}, your favourite language is {fav_lang}, and you confirmed: {confirm}")
inquirer --version
Debug
Known issues
breakingWhen migrating from PyInquirer, note that 'EditorPrompt' is not supported in InquirerPy. Also, parameters for 'CheckboxPrompt' (e.g., `pointer_sign` changed to `pointer`) and keys for 'Style' (e.g., `selected` changed to `pointer`) have been renamed or altered.
fix
Review the InquirerPy migration guide for specific parameter and style key changes, and replace unsupported prompts with alternative InquirerPy options.
affects: All versions (migration from PyInquirer)
deprecatedThe `raise_keyboard_interrupt` parameter in the `.execute()` function is slated for deprecation. Its behavior has changed, and the recommended approach is to provide `raise_keyboard_interrupt` as an initialisation option to the prompt class.
fix
Pass `raise_keyboard_interrupt=True/False` directly when initializing the prompt (e.g., `inquirer.text(message='...', raise_keyboard_interrupt=True)`).
affects: >=0.3.0
gotchaIn version 0.3.4, automatic spacing was introduced for checkbox, expand, and rawlist prompts. If you have custom `enabled_symbol` or `disabled_symbol` configurations, you might need to remove any extra spaces you previously added to maintain alignment.
fix
Inspect custom symbol configurations for checkbox, expand, and rawlist prompts and adjust spacing as needed to accommodate the new automatic spacing.
affects: >=0.3.4
deprecatedFor the `expand` prompt, the `help_msg` parameter has been deprecated in favor of `expand_help` for customising help messages and expansion keys.
fix
Replace `help_msg` with `expand_help` when configuring the `expand` prompt.
affects: >=0.3.0
gotchaThe default value for the `border` parameter in fuzzy prompts was changed from `True` to `False` in version 0.3.4 to ensure consistency with other prompt types.
fix
If you require a border for fuzzy prompts, explicitly set `border=True` during prompt initialization.
affects: >=0.3.4
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'InquirerPy'
The InquirerPy library is not installed in the current Python environment, or there is a typo in the import statement. This can also occur when trying to import the older `inquirer` or `PyInquirer` library with the `InquirerPy` package name.
fix
Install the library using `pip install InquirerPy`. If using a virtual environment, ensure it is activated. Verify import statements match `from InquirerPy import inquirer` or `from InquirerPy.prompts.input import InputPrompt`.
InquirerPy.exceptions.RequiredKeyNotFound
When using the `InquirerPy.resolver.prompt` (classic syntax), a question dictionary is missing one of the mandatory keys such as 'type', 'message', or 'name'.
fix
Ensure all dictionaries passed in the `questions` list have at least `'type'` and `'message'` keys defined. For result retrieval, include a `'name'` key.
KeyboardInterrupt (Ctrl+C does not exit program or skips unexpectedly)
The `raise_keyboard_interrupt` parameter, when set to `False`, causes `Ctrl+C` to skip the current prompt instead of raising a `KeyboardInterrupt` exception and terminating the program.
fix
To make `Ctrl+C` terminate the program, set `raise_keyboard_interrupt=True` (which is the default in newer versions, but might be explicitly set to `False` by users) in your `inquirer.prompt` or specific prompt method call.
AttributeError: 'InputPrompt' object has no attribute 'some_expected_attribute' or TypeError: 'InputPrompt' object is not subscriptable
When using the alternate syntax (e.g., `inquirer.text(...)`), the `.execute()` method was forgotten, so the code is attempting to operate on the prompt *object* itself rather than the *result* returned by the user.
fix
Append `.execute()` to your prompt call to retrieve the user's input, like `name = inquirer.text(message='What\'s your name:').execute()`.
Upgrade
Version history
0.3.4latest on PyPI · released Jun 27, 2022
Audit
Dependencies
prompt_toolkitrequiredCore dependency for interactive terminal features.
pfzyrequiredRequired for fuzzy string matching in relevant prompts.
boto3optionalOnly required for running specific examples; not a core library dependency.
Agent activity
57 hits · last 30 days
node
50
OpenAI (training)
1
Resources
inquirerpy — pip install inquirerpy · libregistry