kedro/framework/cli/cli.py
def _create_project(
    config_path: str,
    verbose: bool,
    template_path: Path = TEMPLATE_PATH,
    should_prompt_for_example: bool = True,
    checkout: str = None,
):
    """Implementation of the kedro new cli command.

    Args:
        config_path: In non-interactive mode, the path of the config.yml which
            should contain the project_name, output_dir and repo_name.
        verbose: Extensive debug terminal logs.
        template_path: The path to the cookiecutter template to create the project.
            It could either be a local directory or a remote VCS repository
            supported by cookiecutter. For more details, please see:
            https://cookiecutter.readthedocs.io/en/latest/usage.html#generate-your-project
        should_prompt_for_example: Whether to display a prompt to generate an example pipeline.
            N.B.: this should only be here until the start project is complete and the
            starters with example are all located in public repositories.
        checkout: The tag, branch or commit in the starter repository to checkout.
            Maps directly to cookiecutter's --checkout argument.
            If the value is invalid, cookiecutter will use the default branch.
    """
    with _filter_deprecation_warnings():
        # pylint: disable=import-outside-toplevel
        from cookiecutter.main import cookiecutter  # for performance reasons
        from cookiecutter.exceptions import RepositoryNotFound

    try:
        if config_path:
            config = _parse_config(config_path, verbose)
            config = _check_config_ok(config_path, config)
        else:
            config = _get_config_from_prompts(should_prompt_for_example)
        config.setdefault("kedro_version", version)

        result_path = Path(
            cookiecutter(
                str(template_path),
                output_dir=config["output_dir"],
                no_input=True,
                extra_context=config,
                checkout=checkout,
            )
        )

        # If user was prompted to generate an example but chooses not to,
        # Remove all placeholder directories.
        if should_prompt_for_example and not config["include_example"]:
            (result_path / "data" / "01_raw" / "iris.csv").unlink()

            pipelines_dir = result_path / "src" / config["python_package"] / "pipelines"

            for dir_path in [
                pipelines_dir / "data_engineering",
                pipelines_dir / "data_science",
            ]:
                shutil.rmtree(str(dir_path))

        _clean_pycache(result_path)
        _print_kedro_new_success_message(result_path)
    except click.exceptions.Abort:  # pragma: no cover
        _handle_exception("User interrupt.")
    except RepositoryNotFound:
        _handle_exception(f"Kedro project template not found at {template_path}")
    # we don't want the user to see a stack trace on the cli
    except Exception:  # pylint: disable=broad-except
        _handle_exception("Failed to generate project.")
Implementation of the kedro new cli command.

    Args:
        config_path: In non-interactive mode, the path of the config.yml which
            should contain the project_name, output_dir and repo_name.
        verbose: Extensive debug terminal logs.
        template_path: The path to the cookiecutter template to create the project.
            It could either be a local directory or a remote VCS repository
            supported by cookiecutter. For more details, please see:
            https://cookiecutter.readthedocs.io/en/latest/usage.html#generate-your-project
        should_prompt_for_example: Whether to display a prompt to generate an example pipeline.
            N.B.: this should only be here until the start project is complete and the
            starters with example are all located in public repositories.
        checkout: The tag, branch or commit in the starter repository to checkout.
            Maps directly to cookiecutter's --checkout argument.
            If the value is invalid, cookiecutter will use the default branch.
    
Implementation of the kedro new cli command.
Implementation of the kedro new cli command .
def _create_project(
    config_path: str,
    verbose: bool,
    template_path: Path = TEMPLATE_PATH,
    should_prompt_for_example: bool = True,
    checkout: str = None,
):
    with _filter_deprecation_warnings():
        from cookiecutter.main import cookiecutter  
        from cookiecutter.exceptions import RepositoryNotFound
    try:
        if config_path:
            config = _parse_config(config_path, verbose)
            config = _check_config_ok(config_path, config)
        else:
            config = _get_config_from_prompts(should_prompt_for_example)
        config.setdefault("kedro_version", version)
        result_path = Path(
            cookiecutter(
                str(template_path),
                output_dir=config["output_dir"],
                no_input=True,
                extra_context=config,
                checkout=checkout,
            )
        )
        if should_prompt_for_example and not config["include_example"]:
            (result_path / "data" / "01_raw" / "iris.csv").unlink()
            pipelines_dir = result_path / "src" / config["python_package"] / "pipelines"
            for dir_path in [
                pipelines_dir / "data_engineering",
                pipelines_dir / "data_science",
            ]:
                shutil.rmtree(str(dir_path))
        _clean_pycache(result_path)
        _print_kedro_new_success_message(result_path)
    except click.exceptions.Abort:  
        _handle_exception("User interrupt.")
    except RepositoryNotFound:
        _handle_exception(f"Kedro project template not found at {template_path}")
    except Exception:  
        _handle_exception("Failed to generate project.")
def _create_project ( config_path : str , verbose : bool , template_path : Path = TEMPLATE_PATH , should_prompt_for_example : bool = True , checkout : str = None , ) : with _filter_deprecation_warnings ( ) : from cookiecutter . main import cookiecutter from cookiecutter . exceptions import RepositoryNotFound try : if config_path : config = _parse_config ( config_path , verbose ) config = _check_config_ok ( config_path , config ) else : config = _get_config_from_prompts ( should_prompt_for_example ) config . setdefault ( "kedro_version" , version ) result_path = Path ( cookiecutter ( str ( template_path ) , output_dir = config [ "output_dir" ] , no_input = True , extra_context = config , checkout = checkout , ) ) if should_prompt_for_example and not config [ "include_example" ] : ( result_path / "data" / "01_raw" / "iris.csv" ) . unlink ( ) pipelines_dir = result_path / "src" / config [ "python_package" ] / "pipelines" for dir_path in [ pipelines_dir / "data_engineering" , pipelines_dir / "data_science" , ] : shutil . rmtree ( str ( dir_path ) ) _clean_pycache ( result_path ) _print_kedro_new_success_message ( result_path ) except click . exceptions . Abort : _handle_exception ( "User interrupt." ) except RepositoryNotFound : _handle_exception ( f"Kedro project template not found at {template_path}" ) except Exception : _handle_exception ( "Failed to generate project." )
Implementation of the kedro new cli command.
Implementation of the kedro new cli command .
"""Implementation of the kedro new cli command.

    Args:
        config_path: In non-interactive mode, the path of the config.yml which
            should contain the project_name, output_dir and repo_name.
        verbose: Extensive debug terminal logs.
        template_path: The path to the cookiecutter template to create the project.
            It could either be a local directory or a remote VCS repository
            supported by cookiecutter. For more details, please see:
            https://cookiecutter.readthedocs.io/en/latest/usage.html#generate-your-project
        should_prompt_for_example: Whether to display a prompt to generate an example pipeline.
            N.B.: this should only be here until the start project is complete and the
            starters with example are all located in public repositories.
        checkout: The tag, branch or commit in the starter repository to checkout.
            Maps directly to cookiecutter's --checkout argument.
            If the value is invalid, cookiecutter will use the default branch.
    """ # pylint: disable=import-outside-toplevel # for performance reasons # If user was prompted to generate an example but chooses not to, # Remove all placeholder directories. # pragma: no cover # we don't want the user to see a stack trace on the cli # pylint: disable=broad-except
config_path
str
In non-interactive mode, the path of the config.yml which
should contain the project_name, output_dir and repo_name.
In non - interactive mode the path of the config . yml which should contain the project_name output_dir and repo_name .
verbose
bool
Extensive debug terminal logs.
Extensive debug terminal logs .
template_path
Path
The path to the cookiecutter template to create the project.
It could either be a local directory or a remote VCS repository
supported by cookiecutter.
The path to the cookiecutter template to create the project . It could either be a local directory or a remote VCS repository supported by cookiecutter .
should_prompt_for_example
bool
Whether to display a prompt to generate an example pipeline.
N.B.: this should only be here until the start project is complete and the
starters with example are all located in public repositories.
Whether to display a prompt to generate an example pipeline . N . B . : this should only be here until the start project is complete and the starters with example are all located in public repositories .
checkout
str
The tag, branch or commit in the starter repository to checkout.
Maps directly to cookiecutter's --checkout argument.
If the value is invalid, cookiecutter will use the default branch.
The tag branch or commit in the starter repository to checkout . Maps directly to cookiecutter ' s -- checkout argument . If the value is invalid cookiecutter will use the default branch .