or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/questionary@2.1.x
tile.json

tessl/pypi-questionary

tessl install tessl/pypi-questionary@2.1.0

Python library to build pretty command line user prompts with interactive forms and validation

Agent Success

Agent success rate when using this tile

96%

Improvement

Agent success rate improvement when using this tile compared to baseline

1x

Baseline

Agent success rate without this tile

96%

task.mdevals/scenario-5/

User Configuration Wizard

A command-line configuration wizard that collects user settings for a new project setup using interactive prompts.

Capabilities

Multi-Question Configuration Flow

Collects multiple configuration settings from the user through a series of interactive prompts defined in a dictionary-based structure. The configuration flow should handle different prompt types and return all answers as a dictionary.

  • When given a list of configuration questions, the wizard displays each prompt in sequence and collects user input @test
  • The wizard returns a dictionary containing all collected configuration values with question names as keys @test

Conditional Question Display

Shows or hides certain questions based on previous answers using conditional logic.

  • When a user selects "yes" for advanced settings, additional configuration prompts are displayed @test
  • When a user selects "no" for advanced settings, additional configuration prompts are skipped @test

Answer Transformation

Transforms user answers before storing them in the final configuration dictionary using filter functions.

  • User input for project name is automatically converted to lowercase before being stored @test
  • User input for directory path has trailing slashes removed before being stored @test

Implementation

@generates

API

def create_configuration_wizard(questions: list[dict]) -> dict:
    """
    Creates and runs a configuration wizard based on a list of question definitions.

    Args:
        questions: List of question dictionaries, each containing:
            - type: The prompt type (e.g., 'text', 'confirm', 'select')
            - name: The key for storing the answer
            - message: The prompt message to display
            - when (optional): Callable that determines if question should be shown
            - filter (optional): Callable to transform the answer
            - default (optional): Default value for the prompt
            - choices (optional): List of choices for select-type prompts

    Returns:
        Dictionary containing all collected answers with question names as keys
    """
    pass

Dependencies { .dependencies }

questionary { .dependency }

Provides interactive command-line prompts with dictionary-based configuration support.