from pathlib import Path
from typing import Any
import json


def templatevariable(template: Path, name: str) -> Any:
    """Return the value of a template variable."""
    path = template / "cookiecutter.json"
    data = json.loads(path.read_text())
    return data[name]