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

Function _paper_file_stem

agents/reading-agent/main.py:303–314  ·  view source on GitHub ↗
(paper: Dict[str, Any])

Source from the content-addressed store, hash-verified

301
302
303def _paper_file_stem(paper: Dict[str, Any]) -> str:
304 arxiv_id = _clean_text(paper.get("arxiv_id"))
305 if arxiv_id:
306 return _safe_filename(arxiv_id.replace("/", "-"))
307 doi = _clean_text(paper.get("doi"))
308 if doi:
309 return "doi-" + _safe_filename(doi, max_len=110)
310 title = _clean_text(paper.get("title"))
311 if title:
312 return _safe_filename(title)
313 paper_id = _clean_text(paper.get("id"))
314 return _safe_filename(paper_id or "paper")
315
316
317def _paper_title_file_stem(paper: Dict[str, Any], *, max_len: int = 96) -> str:

Callers 3

_paper_title_file_stemFunction · 0.85
_persist_pdf_fileFunction · 0.85

Calls 3

_safe_filenameFunction · 0.85
getMethod · 0.80
_clean_textFunction · 0.70

Tested by

no test coverage detected