Format Identifier

class ESSArch_Core.fixity.format.FormatIdentifier(allow_unknown_file_types=False, allow_encrypted_files=False)[source]
identify_file_format(filename)[source]

Identifies the format of the file using the fido library

Parameters

filename – The filename to identify

Returns

A tuple with the format name, version and registry key

FormatIdentifier is used to identify the format of files during validation, XML generation and viewing files in the browser.

MIME types

The file at path_mimetypes_definitionfile is used to identify the MIME type of the file. If the file extension is missing from the MIME types file it will be set to application/octet-stream if allow_unknown_file_types is set to True. If allow_unknown_file_types is set to False an exception will be raised.

Fido

The fido library is used to get the format name, version and registry key of the file.