create
Methods for generating projects.
Classes¶
Functions¶
create_cmd
¶
create_cmd(
path_or_url: str,
output_dir: Optional[Path] = None,
no_input: bool = False,
checkout: Optional[str] = None,
directory: Optional[str] = None,
overwrite_if_exists: bool = False,
skip_if_file_exists: bool = False,
default_config: bool = False,
accept_hooks: str = "all",
initial_context: Optional[
MutableMapping[str, Any]
] = None,
) -> Path
Generate a new project from a composition file, local template or remote template.
Parameters:
path_or_url-
The path or url to the composition file or template
TYPE:
str output_dir-
Where to generate the project
DEFAULT:
None no_input-
If
Trueforce each layer’sno_inputattribute toTrueTYPE:
boolDEFAULT:
False checkout-
The branch, tag or commit to check out after git clone
DEFAULT:
None directory-
Directory within repo that holds cookiecutter.json file
DEFAULT:
None overwrite_if_exists-
Overwrite the contents of the output directory if it already exists
TYPE:
boolDEFAULT:
False skip_if_file_exists-
Skip the files in the corresponding directories if they already exist
TYPE:
boolDEFAULT:
False default_config-
Do not load a config file. Use the defaults instead
TYPE:
boolDEFAULT:
False accept_hooks-
Which pre/post hooks should be applied?
TYPE:
strDEFAULT:
'all' initial_context-
The initial context for the composition
TYPE:
Optional[MutableMapping[str, Any]]DEFAULT:
None
Raises:
-
ClickException -
If there is a problem cloning the repository
Returns:
-
Path -
The path to the generated project.