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-6/

Directory Configuration Tool

Build a command-line configuration utility that helps users select directories for application settings. The tool should collect three directory paths from the user and save them to a configuration file.

Requirements

The utility should prompt the user to select three directories:

  1. Project directory: The main project working directory (must be a directory only, not a file)
  2. Output directory: Where generated files will be saved (must be a directory only, not a file)
  3. Cache directory: Where temporary cache files will be stored (must be a directory only, not a file)

After collecting all three directory paths, save them to a JSON configuration file named config.json with the following structure:

{
  "project_dir": "/path/to/project",
  "output_dir": "/path/to/output",
  "cache_dir": "/path/to/cache"
}

Implementation

@generates

The program should:

  • Display clear prompts for each directory selection
  • Only allow users to select directories (not individual files)
  • Validate that the selected paths exist
  • Write the configuration to config.json in the current working directory

Test Cases

  • The tool prompts for project directory and only allows selecting directories @test
  • The tool prompts for output directory and only allows selecting directories @test
  • The tool prompts for cache directory and only allows selecting directories @test
  • The tool saves all three directory paths to config.json in the correct format @test

API

def configure_directories():
    """
    Prompt the user to select three directories and save them to config.json.

    Returns:
        dict: A dictionary containing the three directory paths with keys
              'project_dir', 'output_dir', and 'cache_dir'
    """
    pass

if __name__ == "__main__":
    configure_directories()

Dependencies { .dependencies }

questionary { .dependency }

Provides interactive command-line prompts with path selection capabilities.