MCPcopy Index your code
hub / github.com/geekcomputers/Python / sanitize_prefix

Function sanitize_prefix

photo_timestamp_renamer.py:41–46  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

39
40
41def sanitize_prefix(s: str) -> str:
42 s = s.strip()
43 if not s:
44 return ""
45 s = re.sub(r"[^\w\-]+", "_", s)
46 return s[:50]
47
48
49def exif_datetime_original(path: Path) -> datetime | None:

Callers 1

rename_photosFunction · 0.85

Calls 1

subMethod · 0.80

Tested by

no test coverage detected