Skip to main content

prepare_import

Given a filename this will try to calculate the python path, add it to the search path and return the actual module name that is expected.

def prepare_import(
path: string
) - > string

Given a filename this will try to calculate the python path, add it to the search path and return the actual module name that is expected.

Parameters

NameTypeDescription
pathstringThe filesystem path to the Python file or package directory to be prepared for import

Returns

TypeDescription
stringThe fully qualified Python module name in dot-notation, suitable for use with importlib or the import statement