Skip to content

Templates

templates

Template path resolution for Copier scaffold templates.

TemplateInfo

Bases: BaseModel

Template metadata.

Source code in packages/axm-init/src/axm_init/core/templates.py
class TemplateInfo(BaseModel):
    """Template metadata."""

    name: str
    description: str
    path: Path

    model_config = {"extra": "forbid"}

TemplateType

Bases: StrEnum

Available scaffold template types.

Source code in packages/axm-init/src/axm_init/core/templates.py
class TemplateType(StrEnum):
    """Available scaffold template types."""

    STANDALONE = "standalone"
    WORKSPACE = "workspace"
    MEMBER = "member"

get_template_path(template_type=TemplateType.STANDALONE)

Return path to a bundled Copier template.

Parameters:

Name Type Description Default
template_type TemplateType

Type of template to look up.

STANDALONE

Returns:

Type Description
Path

Path to the bundled template directory.

Source code in packages/axm-init/src/axm_init/core/templates.py
def get_template_path(
    template_type: TemplateType = TemplateType.STANDALONE,
) -> Path:
    """Return path to a bundled Copier template.

    Args:
        template_type: Type of template to look up.

    Returns:
        Path to the bundled template directory.
    """
    dir_name = _TEMPLATE_DIRS[template_type]
    return Path(str(TEMPLATES_PKG / dir_name))