importers#

Module containing methods to import and export objects by string.

Module Contents#

Functions#

import_python_object_from_string(→ Any)

Import a python object from a string.

export_python_object_to_path_string(→ str)

Get the absolute path (dot-separated) to a python object.

import_python_object_from_string(function_string: str) Any[source]#

Import a python object from a string.

This function does the inverse operation of export_python_object_to_path_string().

(Based on https://stackoverflow.com/questions/3061/calling-a-function-of-a-module-by-using-its-name-a-string)

export_python_object_to_path_string(obj: Any) str[source]#

Get the absolute path (dot-separated) to a python object.

This function does the inverse operation of import_python_object_from_string().

Parameters:

obj (Any) – Any python object.

Returns:

A string containing a dot-separated absolute path to the object.

Return type:

str