Skip to content

source

Entry point for cookiecutter templates.

get_template_repo(
    url: str,
    local_path: Optional[Path] = None,
    checkout: Optional[str] = None,
    password: Optional[str] = None,
) -> TemplateRepo

Get a template repository from a URL.

Parameters:

url

The string from the template field in the composition file.

TYPE: str

local_path

Used to resolve local paths.

TYPE: Optional[Path]

DEFAULT: None

checkout

The branch, tag or commit to check out after git clone

TYPE: Optional[str]

DEFAULT: None

password

The password to use if template is a password-protected Zip archive.

TYPE: Optional[str]

DEFAULT: None

Returns:

TemplateRepo

A TemplateRepo object.

identify_repo(
    url: str, local_path: Optional[Path] = None
) -> Tuple[TemplateFormat, Locality]

Identify the repo format and locality from the URL.

resolve_local_path(
    url: str, local_path: Optional[Path] = None
) -> Path

Resolve a local path.

Parameters:

url

The string from the template field in the composition file.

TYPE: str

local_path

An optional path to resolve the URL against.

TYPE: Optional[Path]

DEFAULT: None

Returns:

Path

The resolved path.