MCPcopy Create free account
hub / github.com/LLMQuant/quant-mind / _normalize_doi

Function _normalize_doi

quantmind/preprocess/fetch/doi.py:36–43  ·  view source on GitHub ↗

Strip common decorations from a user-supplied DOI string.

(raw: str)

Source from the content-addressed store, hash-verified

34
35
36def _normalize_doi(raw: str) -> str:
37 """Strip common decorations from a user-supplied DOI string."""
38 cleaned = raw.strip()
39 for prefix in ("https://doi.org/", "http://doi.org/", "doi:", "DOI:"):
40 if cleaned.startswith(prefix):
41 cleaned = cleaned[len(prefix) :]
42 break
43 return cleaned
44
45
46def _parse_crossref_date(parts: list[list[int]] | None) -> datetime | None:

Callers 1

resolve_doiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected