inquirer package¶
Subpackages¶
Submodules¶
inquirer.errors module¶
-
exception
inquirer.errors.
Aborted
¶
-
exception
inquirer.errors.
EndOfInput
(selection, *args)¶
-
exception
inquirer.errors.
InquirerError
¶ Bases:
exceptions.Exception
-
exception
inquirer.errors.
ThemeError
¶ Bases:
exceptions.AttributeError
-
exception
inquirer.errors.
UnknownQuestionTypeError
¶
-
exception
inquirer.errors.
ValidationError
(value, reason=None, *args)¶
inquirer.events module¶
-
class
inquirer.events.
Event
¶ Bases:
object
-
class
inquirer.events.
KeyPressed
(value)¶ Bases:
inquirer.events.Event
-
class
inquirer.events.
Repaint
¶ Bases:
inquirer.events.Event
inquirer.prompt module¶
-
inquirer.prompt.
prompt
(questions, render=None, answers=None, theme=<inquirer.themes.Default object>, raise_keyboard_interrupt=False)¶
inquirer.questions module¶
Module that implements the questions types
-
class
inquirer.questions.
Checkbox
(name, message='', choices=None, default=None, ignore=False, validate=True, show_default=False)¶ Bases:
inquirer.questions.Question
-
kind
= 'checkbox'¶
-
-
class
inquirer.questions.
Confirm
(name, default=False, **kwargs)¶ Bases:
inquirer.questions.Question
-
kind
= 'confirm'¶
-
-
class
inquirer.questions.
Editor
(name, message='', default=None, **kwargs)¶ Bases:
inquirer.questions.Text
-
kind
= 'editor'¶
-
-
class
inquirer.questions.
List
(name, message='', choices=None, default=None, ignore=False, validate=True, carousel=False)¶ Bases:
inquirer.questions.Question
-
kind
= 'list'¶
-
-
class
inquirer.questions.
Password
(name, echo='*', **kwargs)¶ Bases:
inquirer.questions.Text
-
kind
= 'password'¶
-
-
class
inquirer.questions.
Path
(name, default=None, path_type='any', exists=None, normalize_to_absolute_path=False, **kwargs)¶ Bases:
inquirer.questions.Text
-
ANY
= 'any'¶
-
DIRECTORY
= 'directory'¶
-
FILE
= 'file'¶
-
kind
= 'path'¶
-
normalize_value
(value)¶
-
validate
(current)¶
-
-
class
inquirer.questions.
Question
(name, message='', choices=None, default=None, ignore=False, validate=True, show_default=False)¶ Bases:
object
-
choices
¶
-
choices_generator
¶
-
default
¶
-
ignore
¶
-
kind
= 'base question'¶
-
message
¶
-
validate
(current)¶
-
-
class
inquirer.questions.
TaggedValue
(label, value)¶ Bases:
object
-
class
inquirer.questions.
Text
(name, message='', default=None, **kwargs)¶ Bases:
inquirer.questions.Question
-
kind
= 'text'¶
-
-
inquirer.questions.
is_pathname_valid
(pathname)¶ True if the passed pathname is a valid pathname for the current OS; False otherwise.
-
inquirer.questions.
load_from_dict
(question_dict)¶ Load one question from a dict. It requires the keys ‘name’ and ‘kind’. :return: The Question object with associated data. :return type: Question
-
inquirer.questions.
load_from_json
(question_json)¶ Load Questions from a JSON string. :return: A list of Question objects with associated data if the JSON
contains a list or a Question if the JSON contains a dict.Return type: List or Dict
-
inquirer.questions.
load_from_list
(question_list)¶ Load a list of questions from a list of dicts. It requires the keys ‘name’ and ‘kind’ for each dict. :return: A list of Question objects with associated data. :return type: List
-
inquirer.questions.
question_factory
(kind, *args, **kwargs)¶
inquirer.shortcuts module¶
-
inquirer.shortcuts.
checkbox
(message, render=None, **kwargs)¶
-
inquirer.shortcuts.
confirm
(message, render=None, **kwargs)¶
-
inquirer.shortcuts.
editor
(message, render=None, **kwargs)¶
-
inquirer.shortcuts.
list_input
(message, render=None, **kwargs)¶
-
inquirer.shortcuts.
password
(message, render=None, **kwargs)¶
-
inquirer.shortcuts.
path
(message, render=None, **kwargs)¶
-
inquirer.shortcuts.
text
(message, render=None, **kwargs)¶
inquirer.themes module¶
-
class
inquirer.themes.
Default
¶ Bases:
inquirer.themes.Theme
-
class
inquirer.themes.
GreenPassion
¶ Bases:
inquirer.themes.Theme
-
class
inquirer.themes.
Theme
¶ Bases:
object
-
inquirer.themes.
load_theme_from_dict
(dict_theme)¶ Load a theme from a dict. Expected format: {
- “Question”: {
- “mark_color”: “yellow”, “brackets_color”: “normal”, …
}, “List”: {
“selection_color”: “bold_blue”, “selection_cursor”: “->”}
}
Color values should be string representing valid blessings.Terminal colors.
-
inquirer.themes.
load_theme_from_json
(json_theme)¶ Load a theme from a json. Expected format: {
- “Question”: {
- “mark_color”: “yellow”, “brackets_color”: “normal”, …
}, “List”: {
“selection_color”: “bold_blue”, “selection_cursor”: “->”}
}
Color values should be string representing valid blessings.Terminal colors.
Module contents¶
-
inquirer.
prompt
(questions, render=None, answers=None, theme=<inquirer.themes.Default object>, raise_keyboard_interrupt=False)¶
-
class
inquirer.
Text
(name, message='', default=None, **kwargs)¶ Bases:
inquirer.questions.Question
-
kind
= 'text'¶
-
-
class
inquirer.
Editor
(name, message='', default=None, **kwargs)¶ Bases:
inquirer.questions.Text
-
kind
= 'editor'¶
-
-
class
inquirer.
Password
(name, echo='*', **kwargs)¶ Bases:
inquirer.questions.Text
-
kind
= 'password'¶
-
-
class
inquirer.
Confirm
(name, default=False, **kwargs)¶ Bases:
inquirer.questions.Question
-
kind
= 'confirm'¶
-
-
class
inquirer.
List
(name, message='', choices=None, default=None, ignore=False, validate=True, carousel=False)¶ Bases:
inquirer.questions.Question
-
kind
= 'list'¶
-
-
class
inquirer.
Checkbox
(name, message='', choices=None, default=None, ignore=False, validate=True, show_default=False)¶ Bases:
inquirer.questions.Question
-
kind
= 'checkbox'¶
-
-
class
inquirer.
Path
(name, default=None, path_type='any', exists=None, normalize_to_absolute_path=False, **kwargs)¶ Bases:
inquirer.questions.Text
-
ANY
= 'any'¶
-
DIRECTORY
= 'directory'¶
-
FILE
= 'file'¶
-
kind
= 'path'¶
-
normalize_value
(value)¶
-
validate
(current)¶
-
-
inquirer.
load_from_list
(question_list)¶ Load a list of questions from a list of dicts. It requires the keys ‘name’ and ‘kind’ for each dict. :return: A list of Question objects with associated data. :return type: List
-
inquirer.
load_from_dict
(question_dict)¶ Load one question from a dict. It requires the keys ‘name’ and ‘kind’. :return: The Question object with associated data. :return type: Question
-
inquirer.
load_from_json
(question_json)¶ Load Questions from a JSON string. :return: A list of Question objects with associated data if the JSON
contains a list or a Question if the JSON contains a dict.Return type: List or Dict
-
inquirer.
text
(message, render=None, **kwargs)¶
-
inquirer.
editor
(message, render=None, **kwargs)¶
-
inquirer.
password
(message, render=None, **kwargs)¶
-
inquirer.
confirm
(message, render=None, **kwargs)¶
-
inquirer.
list_input
(message, render=None, **kwargs)¶
-
inquirer.
checkbox
(message, render=None, **kwargs)¶