kedro is a CLI for managing Kedro projects.
This module implements commands available from the kedro CLI for creating projects.
Class |
|
Specification of custom kedro starter template |
Function | create |
Undocumented |
Function | list |
List all official project starters available. |
Function | new |
Create a new kedro project. |
Function | starter |
Commands for working with project starters. |
Constant | CHECKOUT |
Undocumented |
Constant | CONFIG |
Undocumented |
Constant | DIRECTORY |
Undocumented |
Constant | KEDRO |
Undocumented |
Constant | STARTER |
Undocumented |
Constant | TEMPLATE |
Undocumented |
Class | _ |
Represent a single CLI prompt for kedro new |
Function | _create |
Creates a new kedro project using cookiecutter. |
Function | _fetch |
Obtains configuration for a new kedro project non-interactively from a file. |
Function | _fetch |
Interactively obtains information from user prompts. |
Function | _get |
Undocumented |
Function | _get |
Gives a path to the cookiecutter directory. If template_path is a repo then clones it to tmpdir; if template_path is a file path then directly uses that path without copying anything. |
Function | _get |
Finds the information a user must supply according to prompts.yml. |
Function | _get |
This function lists all the starter aliases declared in the core repo and in plugins entry points. |
Function | _make |
Creates a dictionary of arguments to pass to cookiecutter. |
Function | _make |
Undocumented |
Function | _remove |
Remove readonly files on Windows See: https://docs.python.org/3/library/shutil.html?highlight=shutil#rmtree-example |
Function | _starter |
Convert a dictionary of starters spec to a nicely formatted dictionary |
Function | _validate |
Checks that the configuration file contains all needed variables. |
Constant | _OFFICIAL |
Undocumented |
Constant | _STARTERS |
Undocumented |
@click.option(
@click.option(
@click.option(
@click.option(
def new(config_path, starter_alias, checkout, directory, **kwargs): (source) ¶
Create a new kedro project.
Undocumented
Value |
|
Undocumented
Value |
|
Creates a new kedro project using cookiecutter.
Parameters | |
templatestr | 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 |
cookiecutterDict[ | Arguments to pass to cookiecutter. |
Raises | |
KedroCliError | If it fails to generate a project. |
Obtains configuration for a new kedro project non-interactively from a file.
Parameters | |
configstr | The path of the config.yml which should contain the data required by prompts.yml. |
Returns | |
Dict[ |
|
Raises | |
KedroCliError | If the file cannot be parsed. |
Dict[ str, Any]
, cookiecutter_context: OrderedDict
) -> Dict[ str, str]
:
(source)
¶
Interactively obtains information from user prompts.
Parameters | |
prompts:Dict[ | Prompts from prompts.yml. |
cookiecutterOrderedDict | Cookiecutter context generated from cookiecutter.json. |
Returns | |
Dict[ |
|
str
, checkout: str
, directory: str
, tmpdir: str
) -> Path
:
(source)
¶
Gives a path to the cookiecutter directory. If template_path is a repo then clones it to tmpdir; if template_path is a file path then directly uses that path without copying anything.
This function lists all the starter aliases declared in the core repo and in plugins entry points.
For example, the output for official kedro starters looks like: {"astro-airflow-iris":
- KedroStarterSpec(
- name="astro-airflow-iris", template_path="git+https://github.com/kedro-org/kedro-starters.git", directory="astro-airflow-iris", origin="kedro"
),
- "astro-iris":
- KedroStarterSpec(
- name="astro-iris", template_path="git+https://github.com/kedro-org/kedro-starters.git", directory="astro-airflow-iris", origin="kedro"
),
}
Dict[ str, str]
, checkout: str
, directory: str
) -> Dict[ str, Any]
:
(source)
¶
Creates a dictionary of arguments to pass to cookiecutter.
Parameters | |
config:Dict[ | Configuration for starting a new project. This is passed as extra_context to cookiecutter and will overwrite the cookiecutter.json defaults. |
checkout:str | The tag, branch or commit in the starter repository to checkout. Maps directly to cookiecutter's checkout argument. Relevant only when using a starter. |
directory:str | The directory of a specific starter inside a repository containing multiple starters. Maps directly to cookiecutter's directory argument. Relevant only when using a starter. https://cookiecutter.readthedocs.io/en/1.7.2/advanced/directories.html |
Returns | |
Dict[ | Arguments to pass to cookiecutter. |
Remove readonly files on Windows See: https://docs.python.org/3/library/shutil.html?highlight=shutil#rmtree-example
Dict[ str, KedroStarterSpec]
) -> Dict[ str, Dict[ str, str]]
:
(source)
¶
Convert a dictionary of starters spec to a nicely formatted dictionary
Checks that the configuration file contains all needed variables.
Parameters | |
config:Dict[ | The config as a dictionary. |
prompts:Dict[ | Prompts from prompts.yml. |
Raises | |
KedroCliError | If the config file is empty or does not contain all the keys required in prompts, or if the output_dir specified does not exist. |