MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / slug

Function slug

paperflow/roles.py:15–19  ·  view source on GitHub ↗

Return a filesystem-safe label while preserving readable Unicode names.

(value: Any, *, max_len: int = 96)

Source from the content-addressed store, hash-verified

13
14
15def slug(value: Any, *, max_len: int = 96) -> str:
16 """Return a filesystem-safe label while preserving readable Unicode names."""
17 text = re.sub(r"[^\w.\-]+", "-", str(value or "").strip(), flags=re.UNICODE)
18 text = re.sub(r"-{2,}", "-", text).strip("-._")
19 return (text or "user")[:max_len]
20
21
22def env_flag(name: str, default: bool = False) -> bool:

Callers 4

_normalized_part_labelsFunction · 0.85
_category_labelsFunction · 0.85
apply_output_scopeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected