inquirer3 package¶
Subpackages¶
Submodules¶
inquirer3.errors module¶
- exception inquirer3.errors.EndOfInput(selection, *args)¶
Bases:
Exception
- exception inquirer3.errors.ThemeError¶
Bases:
AttributeError
- exception inquirer3.errors.UnknownQuestionTypeError¶
Bases:
Exception
- exception inquirer3.errors.ValidationError(value, reason=None, *args)¶
Bases:
Exception
inquirer3.events module¶
- class inquirer3.events.Event¶
Bases:
object
inquirer3.prompt module¶
- inquirer3.prompt.prompt(questions, render=None, answers=None, theme=<inquirer3.themes.Default object>, raise_keyboard_interrupt=False)¶
inquirer3.questions module¶
- class inquirer3.questions.Checkbox(name, choices, message='', default=None, ignore=False, validate=True, show_default=False, other=False, trim_header=True, locked=None, carousel=False, autocomplete=None, trim_choices=False)¶
Bases:
Question- Parameters:
name (Hashable) –
choices (Iterable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
other (bool) –
trim_header (bool | Callable) –
locked (List | None) –
carousel (bool) –
autocomplete (Callable | None) –
trim_choices (bool) –
- kind = 'checkbox'¶
- class inquirer3.questions.Confirm(name, message='', default=False, ignore=False, validate=True, trim_header=True)¶
Bases:
Question- Parameters:
name (Hashable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
trim_header (bool | Callable) –
- kind = 'confirm'¶
- class inquirer3.questions.Editor(name, message='', default=None, ignore=False, validate=True, show_default=False, trim_header=True, autocomplete=None)¶
Bases:
Text- Parameters:
name (Hashable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool | Callable) –
autocomplete (Callable | None) –
- kind = 'editor'¶
- class inquirer3.questions.List(name, choices, message='', default=None, ignore=False, validate=True, show_default=False, other=False, trim_header=True, carousel=False, autocomplete=None, trim_choices=False)¶
Bases:
Question- Parameters:
name (Hashable) –
choices (Iterable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
other (bool) –
trim_header (bool | Callable) –
carousel (bool) –
autocomplete (Callable | None) –
trim_choices (bool) –
- kind = 'list'¶
- class inquirer3.questions.Password(name, message='', echo='*', default=None, ignore=False, validate=True, show_default=False, trim_header=True)¶
Bases:
Text- Parameters:
name (Hashable) –
message (Any) –
echo (str) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool | Callable) –
- kind = 'password'¶
- class inquirer3.questions.Path(name, message='', default=None, ignore=False, validate=True, show_default=False, trim_header=True, autocomplete=None, path_type='any', exists=None, normalize_to_absolute_path=False)¶
Bases:
Text- Parameters:
name (Hashable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool | Callable) –
autocomplete (Callable | None) –
path_type (str) –
exists (bool | None) –
normalize_to_absolute_path (bool) –
- ANY = 'any'¶
- DIRECTORY = 'directory'¶
- FILE = 'file'¶
- kind = 'path'¶
- normalize_value(value)¶
- validate(current)¶
- class inquirer3.questions.Question(name, message='', choices=None, default=None, ignore=False, validate=True, show_default=False, other=False, trim_header=True)¶
Bases:
object- Parameters:
name (Hashable) –
message (Any) –
choices (Iterable | None) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
other (bool) –
trim_header (bool | Callable) –
- add_choice(choice)¶
- property choices¶
- property choices_generator¶
- property default¶
- property ignore¶
- kind = 'base question'¶
- property message¶
- validate(current)¶
- class inquirer3.questions.TaggedValue(label, value)¶
Bases:
object
- class inquirer3.questions.Text(name, message='', default=None, ignore=False, validate=True, show_default=False, trim_header=True, autocomplete=None)¶
Bases:
Question- Parameters:
name (Hashable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool | Callable) –
autocomplete (Callable | None) –
- kind = 'text'¶
- inquirer3.questions.is_pathname_valid(pathname)¶
True if the passed pathname is a valid pathname for the current OS; False otherwise.
- inquirer3.questions.load_from_dict(question_dict)¶
Load one question from a dict.
It requires the keys ‘name’ and ‘kind’.
- Returns:
The Question object with associated data.
- Return type:
- inquirer3.questions.load_from_json(question_json)¶
Load Questions from a JSON string.
- inquirer3.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.
- Returns:
A list of Question objects with associated data.
- Return type:
List[Question]
- inquirer3.questions.question_factory(kind, *args, **kwargs)¶
inquirer3.shortcuts module¶
- inquirer3.shortcuts.checkbox(choices, message='', default=None, ignore=False, validate=True, show_default=False, other=False, trim_header=True, locked=None, carousel=False, autocomplete=None, trim_choices=False, render=None, raise_keyboard_interrupt=False)¶
- Parameters:
choices (Iterable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
other (bool) –
trim_header (bool | Callable) –
locked (List | None) –
carousel (bool) –
autocomplete (Callable | None) –
trim_choices (bool) –
render (ConsoleRender | None) –
raise_keyboard_interrupt (bool) –
- Return type:
str
- inquirer3.shortcuts.confirm(message='', default=False, ignore=False, validate=True, trim_header=True, render=None, raise_keyboard_interrupt=False)¶
- Parameters:
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
trim_header (bool | Callable) –
render (ConsoleRender | None) –
raise_keyboard_interrupt (bool) –
- Return type:
str
- inquirer3.shortcuts.editor(message, default=None, ignore=False, validate=True, show_default=False, trim_header=True, autocomplete=None, render=None, raise_keyboard_interrupt=False)¶
- Parameters:
message (Any) –
default (str | None) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool) –
autocomplete (Callable | None) –
render (ConsoleRender | None) –
raise_keyboard_interrupt (bool) –
- Return type:
str
- inquirer3.shortcuts.list_input(choices, message='', default=None, ignore=False, validate=True, show_default=False, other=False, trim_header=True, carousel=False, autocomplete=None, trim_choices=False, render=None, raise_keyboard_interrupt=False)¶
- Parameters:
choices (Iterable) –
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
other (bool) –
trim_header (bool | Callable) –
carousel (bool) –
autocomplete (Callable | None) –
trim_choices (bool) –
render (ConsoleRender | None) –
raise_keyboard_interrupt (bool) –
- Return type:
str
- inquirer3.shortcuts.password(message, echo='*', default=None, ignore=False, validate=True, show_default=False, trim_header=True, render=None, raise_keyboard_interrupt=False)¶
- Parameters:
message (Any) –
echo (str) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool | Callable) –
render (ConsoleRender | None) –
raise_keyboard_interrupt (bool) –
- Return type:
str
- inquirer3.shortcuts.path(message='', default=None, ignore=False, validate=True, show_default=False, trim_header=True, autocomplete=None, path_type='any', exists=None, normalize_to_absolute_path=False, render=None, raise_keyboard_interrupt=False)¶
- Parameters:
message (Any) –
default (Any) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool | Callable) –
autocomplete (Callable | None) –
path_type (str) –
exists (bool | None) –
normalize_to_absolute_path (bool) –
render (ConsoleRender | None) –
raise_keyboard_interrupt (bool) –
- Return type:
str
- inquirer3.shortcuts.text(message, default=None, ignore=False, validate=True, show_default=False, trim_header=True, autocomplete=None, render=None, raise_keyboard_interrupt=False)¶
- Parameters:
message (Any) –
default (str | None) –
ignore (bool | Callable) –
validate (bool | Callable) –
show_default (bool | Callable) –
trim_header (bool) –
autocomplete (Callable | None) –
render (ConsoleRender | None) –
raise_keyboard_interrupt (bool) –
- Return type:
str
inquirer3.themes module¶
- class inquirer3.themes.Theme¶
Bases:
object
- inquirer3.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.
- inquirer3.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.