"""template helper functions""" from pathlib import Path import re def get_templates(path: Path): """list templates in given path""" template_pattern = re.compile(r"^[^_]\S+\.mako$") result = list(path.glob("*.mako")) result = [item for item in result if template_pattern.match(item.name)] return result