scitex_template.registry

Registry of templates vendored in this repo.

Reads templates/REGISTRY.yaml from either:
  1. the live git checkout of scitex-template (editable install), or

  2. ~/.scitex/template/cache/templates/REGISTRY.yaml (shallow-clone cache, populated on first cloner call).

The wheel installed from PyPI intentionally does NOT ship templates/ — it contains only the cloner code. At runtime the cloner clones this repo shallowly into ~/.scitex/template/cache/ and reads the registry + template payload from there. Keeps the wheel <100KB while the git repo stays the single source of truth.

Functions

find_template(template_id)

Return the registry entry for template_id, or None.

load_registry()

Parse templates/REGISTRY.yaml and return every entry.

registry_root()

Return the directory that contains templates/REGISTRY.yaml.

Classes

TemplateEntry(id, description, version, path)

class scitex_template.registry.TemplateEntry(id, description, version, path)[source]

Bases: object

description: str
id: str
path: Path
version: str
scitex_template.registry.find_template(template_id)[source]

Return the registry entry for template_id, or None.

Return type:

Optional[TemplateEntry]

scitex_template.registry.load_registry()[source]

Parse templates/REGISTRY.yaml and return every entry.

Raises FileNotFoundError if neither the editable checkout nor the cache is populated — the caller is responsible for triggering a shallow-clone of the scitex-template repo into ~/.scitex/template/cache/.

Return type:

list[TemplateEntry]

scitex_template.registry.registry_root()[source]

Return the directory that contains templates/REGISTRY.yaml.

Return type:

Optional[Path]

Preference order:
  1. Editable checkout (if we’re running from src/scitex_template/).

  2. Cache at ~/.scitex/template/cache/.

  3. None — caller should populate the cache.