def _get_object_from_python_path(python_path):
        """Method that will fetch a Marshmallow schema from a path to it.

        Args:
            python_path (str): The string path to the Marshmallow schema.

        Returns:
            marshmallow.Schema: The schema matching the provided path.

        Raises:
            TypeError: This is raised if the specified object isn't
                a Marshmallow schema.
        """
        # Dissect the path
        python_path = python_path.split('.')
        module_path = python_path[:-1]
        object_class = python_path[-1]

        if isinstance(module_path, list):
            module_path = '.'.join(module_path)

        # Grab the object
        module = import_module(module_path)
        schema = getattr(module, object_class)

        if isclass(schema):
            schema = schema()

        return schema
def _get_object_from_python_path ( python_path ) : python_path = python_path . split ( '.' ) module_path = python_path [ : - 1 ] object_class = python_path [ - 1 ] if isinstance ( module_path , list ) : module_path = '.' . join ( module_path ) module = import_module ( module_path ) schema = getattr ( module , object_class ) if isclass ( schema ) : schema = schema ( ) return schema
Method that will fetch a Marshmallow schema from a path to it.

        Args:
            python_path (str): The string path to the Marshmallow schema.

        Returns:
            marshmallow.Schema: The schema matching the provided path.

        Raises:
            TypeError: This is raised if the specified object isn't
                a Marshmallow schema.