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

Function already_formatted

photo_timestamp_renamer.py:116–119  ·  view source on GitHub ↗
(name: str)

Source from the content-addressed store, hash-verified

114
115
116def already_formatted(name: str) -> bool:
117 # matches: YYYY-MM-DD_HH-MM-SS or with prefix and/or _NN
118 pattern = r"^(?:[A-Za-z0-9_]+_)?\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}(?:_\d{2})?$"
119 return re.match(pattern, Path(name).stem) is not None
120
121
122def gather_photos(folder: Path, recursive: bool) -> list[Path]:

Callers 1

rename_photosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected