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

Function _safe_filename

agents/reading-agent/main.py:295–300  ·  view source on GitHub ↗
(value: Any, *, max_len: int = 120)

Source from the content-addressed store, hash-verified

293
294
295def _safe_filename(value: Any, *, max_len: int = 120) -> str:
296 text = _clean_text(value)
297 text = re.sub(r"[\\/:*?\"<>|]+", "-", text)
298 text = re.sub(r"\s+", " ", text).strip(" .-_")
299 text = re.sub(r"[-_ ]{2,}", "-", text)
300 return (text or "paper")[:max_len].strip(" .-_") or "paper"
301
302
303def _paper_file_stem(paper: Dict[str, Any]) -> str:

Callers 2

_paper_file_stemFunction · 0.85
_paper_title_file_stemFunction · 0.85

Calls 1

_clean_textFunction · 0.70

Tested by

no test coverage detected