kedro/framework/cli/cli.py
def _get_config_from_prompts(should_prompt_for_example: bool = True) -> Dict:
    """Ask user to provide necessary inputs.

    Args:
        should_prompt_for_example: Whether to include a prompt for example.

    Returns:
        Resulting config dictionary.

    """

    # set output directory to the current directory
    output_dir = os.path.abspath(os.path.curdir)

    # get project name
    project_name_prompt = _get_prompt_text(
        "Project Name:",
        "Please enter a human readable name for your new project.",
        "Spaces and punctuation are allowed.",
        start="",
    )

    project_name = _get_user_input(project_name_prompt, default="New Kedro Project")

    normalized_project_name = re.sub(r"[^\w-]+", "-", project_name).lower().strip("-")

    # get repo name
    repo_name_prompt = _get_prompt_text(
        "Repository Name:",
        "Please enter a directory name for your new project repository.",
        "Alphanumeric characters, hyphens and underscores are allowed.",
        "Lowercase is recommended.",
    )
    repo_name = _get_user_input(
        repo_name_prompt,
        default=normalized_project_name,
        check_input=_assert_repo_name_ok,
    )

    # get python package_name
    default_pkg_name = normalized_project_name.replace("-", "_")
    pkg_name_prompt = _get_prompt_text(
        "Python Package Name:",
        "Please enter a valid Python package name for your project package.",
        "Alphanumeric characters and underscores are allowed.",
        "Lowercase is recommended. Package name must start with a letter "
        "or underscore.",
    )
    python_package = _get_user_input(
        pkg_name_prompt, default=default_pkg_name, check_input=_assert_pkg_name_ok
    )

    # option for whether iris example code is included in the project
    if should_prompt_for_example:
        code_example_prompt = _get_prompt_text(
            "Generate Example Pipeline:",
            "Do you want to generate an example pipeline in your project?",
            "Good for first-time users. (default=N)",
        )
        include_example = click.confirm(code_example_prompt, default=False)
    else:
        include_example = False

    return {
        "output_dir": output_dir,
        "project_name": project_name,
        "repo_name": repo_name,
        "python_package": python_package,
        "include_example": include_example,
    }
Ask user to provide necessary inputs.

    Args:
        should_prompt_for_example: Whether to include a prompt for example.

    Returns:
        Resulting config dictionary.

    
Ask user to provide necessary inputs.
Ask user to provide necessary inputs .
def _get_config_from_prompts(should_prompt_for_example: bool = True) -> Dict:
    output_dir = os.path.abspath(os.path.curdir)
    project_name_prompt = _get_prompt_text(
        "Project Name:",
        "Please enter a human readable name for your new project.",
        "Spaces and punctuation are allowed.",
        start="",
    )
    project_name = _get_user_input(project_name_prompt, default="New Kedro Project")
    normalized_project_name = re.sub(r"[^\w-]+", "-", project_name).lower().strip("-")
    repo_name_prompt = _get_prompt_text(
        "Repository Name:",
        "Please enter a directory name for your new project repository.",
        "Alphanumeric characters, hyphens and underscores are allowed.",
        "Lowercase is recommended.",
    )
    repo_name = _get_user_input(
        repo_name_prompt,
        default=normalized_project_name,
        check_input=_assert_repo_name_ok,
    )
    default_pkg_name = normalized_project_name.replace("-", "_")
    pkg_name_prompt = _get_prompt_text(
        "Python Package Name:",
        "Please enter a valid Python package name for your project package.",
        "Alphanumeric characters and underscores are allowed.",
        "Lowercase is recommended. Package name must start with a letter "
        "or underscore.",
    )
    python_package = _get_user_input(
        pkg_name_prompt, default=default_pkg_name, check_input=_assert_pkg_name_ok
    )
    if should_prompt_for_example:
        code_example_prompt = _get_prompt_text(
            "Generate Example Pipeline:",
            "Do you want to generate an example pipeline in your project?",
            "Good for first-time users. (default=N)",
        )
        include_example = click.confirm(code_example_prompt, default=False)
    else:
        include_example = False
    return {
        "output_dir": output_dir,
        "project_name": project_name,
        "repo_name": repo_name,
        "python_package": python_package,
        "include_example": include_example,
    }
def _get_config_from_prompts ( should_prompt_for_example : bool = True ) -> Dict : output_dir = os . path . abspath ( os . path . curdir ) project_name_prompt = _get_prompt_text ( "Project Name:" , "Please enter a human readable name for your new project." , "Spaces and punctuation are allowed." , start = "" , ) project_name = _get_user_input ( project_name_prompt , default = "New Kedro Project" ) normalized_project_name = re . sub ( r"[^\w-]+" , "-" , project_name ) . lower ( ) . strip ( "-" ) repo_name_prompt = _get_prompt_text ( "Repository Name:" , "Please enter a directory name for your new project repository." , "Alphanumeric characters, hyphens and underscores are allowed." , "Lowercase is recommended." , ) repo_name = _get_user_input ( repo_name_prompt , default = normalized_project_name , check_input = _assert_repo_name_ok , ) default_pkg_name = normalized_project_name . replace ( "-" , "_" ) pkg_name_prompt = _get_prompt_text ( "Python Package Name:" , "Please enter a valid Python package name for your project package." , "Alphanumeric characters and underscores are allowed." , "Lowercase is recommended. Package name must start with a letter " "or underscore." , ) python_package = _get_user_input ( pkg_name_prompt , default = default_pkg_name , check_input = _assert_pkg_name_ok ) if should_prompt_for_example : code_example_prompt = _get_prompt_text ( "Generate Example Pipeline:" , "Do you want to generate an example pipeline in your project?" , "Good for first-time users. (default=N)" , ) include_example = click . confirm ( code_example_prompt , default = False ) else : include_example = False return { "output_dir" : output_dir , "project_name" : project_name , "repo_name" : repo_name , "python_package" : python_package , "include_example" : include_example , }
Ask user to provide necessary inputs.
Ask user to provide necessary inputs .
"""Ask user to provide necessary inputs.

    Args:
        should_prompt_for_example: Whether to include a prompt for example.

    Returns:
        Resulting config dictionary.

    """ # set output directory to the current directory # get project name # get repo name # get python package_name # option for whether iris example code is included in the project
Resulting config dictionary.
Resulting config dictionary .
should_prompt_for_example
bool
Whether to include a prompt for example.
Whether to include a prompt for example .