Skip to content

System

Pactole Index / Utils / System

Auto-generated documentation for utils.system module.

import_namespace

Show source in system.py:6

Import a resource from a namespace string.

Arguments

  • namespace str - The namespace string in the format "module.resource".

Returns

  • type - The imported resource.

Raises

  • ValueError - If the namespace string is not in the correct format.
  • ImportError - If the module or resource cannot be imported.
  • AttributeError - If the resource does not exist in the module.

Examples

>>> import_namespace("pactole.data.providers.fdj.FDJResolver")
<class 'pactole.data.providers.fdj.FDJResolver'>

Signature

def import_namespace(namespace: str) -> type: ...