graph LR
User_Facing_API["User-Facing API"]
Prompt_Core_Engine["Prompt Core & Engine"]
Specific_Prompt_Implementations["Specific Prompt Implementations"]
Utility_Layer["Utility Layer"]
User_Facing_API -- "invokes" --> Prompt_Core_Engine
Prompt_Core_Engine -- "returns result to" --> User_Facing_API
Prompt_Core_Engine -- "delegates to" --> Specific_Prompt_Implementations
Specific_Prompt_Implementations -- "utilizes common logic from" --> Prompt_Core_Engine
User_Facing_API -- "uses helpers from" --> Utility_Layer
Prompt_Core_Engine -- "uses helpers from" --> Utility_Layer
Specific_Prompt_Implementations -- "uses helpers from" --> Utility_Layer
The questionary library employs a clear component-based architecture, centralizing user interaction through a User-Facing API that abstracts the complexities of terminal prompting. This API dispatches requests to the Prompt Core & Engine, which acts as the central control unit, orchestrating the prompt's lifecycle and integrating with prompt_toolkit. The core engine then delegates to specialized Specific Prompt Implementations, each responsible for the unique rendering and input handling of a particular prompt type (e.g., text, select, checkbox). A shared Utility Layer provides common helper functions and integrations, supporting all components. This design ensures modularity, allowing for easy extension with new prompt types while maintaining a consistent and robust interaction flow.
The public interface for questionary, providing high-level functions to initiate prompts and forms, handling initial setup and basic error management.
Related Classes/Methods:
questionary.prompt.prompt:25-81questionary.prompt.unsafe_prompt:84-234questionary.question.ask:48-67questionary.question.unsafe_ask:69-89questionary.question.ask_async:26-46questionary.question.unsafe_ask_async:106-134questionary.form.form:35-117questionary.form.unsafe_form:1-100
The central orchestrator managing the prompt lifecycle, integrating with prompt_toolkit, and providing reusable building blocks and common logic for all prompt types.
Related Classes/Methods:
questionary.prompt.unsafe_prompt:84-234questionary.prompts.common.Choicequestionary.prompts.common.Separator:178-195questionary.prompts.common.InquirerControl:198-557
Individual modules, each dedicated to a specific interactive prompt type, defining unique rendering, input processing, and validation rules.
Related Classes/Methods:
questionary.prompts.text:1-100questionary.prompts.password:1-100questionary.prompts.confirm:1-100questionary.prompts.select:1-100questionary.prompts.rawselect:1-100questionary.prompts.checkbox:1-100questionary.prompts.autocomplete:1-100questionary.prompts.path:1-100questionary.prompts.press_any_key_to_continue:1-100
Contains general-purpose helper functions and utilities used across the library for various tasks.
Related Classes/Methods: