extract_msg.open_msg Module

Module contents

extract_msg.open_msg.openMsg(path, **kwargs) MSGFile[source]

Function to automatically open an MSG file and detect what type it is.

Accepts all of the same arguments as the __init__ method for the class it creates. Extra options will be ignored if the class doesn’t know what to do with them, but child instances may end up using them if they understand them. See MSGFile.__init__ for a list of all globally recognized options.

Parameters:

strict – If set to True, this function will raise an exception when it cannot identify what MSGFile derivitive to use. Otherwise, it will log the error and return a basic MSGFile instance. Default is True.

Raises:
extract_msg.open_msg.openMsgBulk(path, **kwargs) List[MSGFile] | Tuple[Exception, str | bytes][source]

Takes the same arguments as openMsg, but opens a collection of MSG files based on a wild card. Returns a list if successful, otherwise returns a tuple.

Parameters:

ignoreFailures – If this is True, will return a list of all successful files, ignoring any failures. Otherwise, will close all that successfully opened, and return a tuple of the exception and the path of the file that failed.