Skip to content

presets

Preset declarative pipelines.

list_presets

list_presets() -> list[str]

Return available preset names.

Source code in cltk/pipeline/presets.py
def list_presets() -> list[str]:
    """Return available preset names."""
    return sorted(_PRESETS)

get_preset

get_preset(name: str) -> PipelineSpec

Return a deep copy of the named preset.

Source code in cltk/pipeline/presets.py
def get_preset(name: str) -> PipelineSpec:
    """Return a deep copy of the named preset."""
    try:
        preset = _PRESETS[name]
    except KeyError as exc:
        available = ", ".join(sorted(_PRESETS))
        raise KeyError(f"Unknown preset '{name}'. Available: {available}") from exc
    return preset.model_copy(deep=True)