filefinder.library#

Functions to retrieve values from filename.

Functions

get_date(matches[, default_date])

Retrieve date from matched elements.

get_date(matches, default_date=None)#

Retrieve date from matched elements.

If a matcher is not found in the filename, it will be replaced by the element of the default date argument. Matchers that can be used are (in order of increasing priority): YBmdjHMSFxX. If two matchers have the same name, the last one in the pre-regex will get priority.

Parameters:
  • matches (Matches) – Matches obtained from a filename.

  • default_date (dict | None) – Default date. Dictionnary with keys: year, month, day, hour, minute, and second. Defaults to 1970-01-01 00:00:00

Return type:

datetime