maui.files_metadata.extract_metadata

maui.files_metadata.extract_metadata(string, format_name, date_time_func=None, format_file_path=None)[source]

Extract metadata from a string based on a specified format.

Parameters:
stringstr

The string from which metadata will be extracted.

format_namestr

Name of the format to use for metadata extraction.

date_time_funcfunction, optional

A function to handle date and time processing for extracted metadata. Default is None.

format_file_pathstr, optional

Path to the YAML file containing format configurations. Default is ‘files_formats.yaml’.

Returns:
dict or None

A dictionary containing extracted metadata if successful, None otherwise.

Raises:
ValueError

If the specified format is not found in the format file.