Utilities
The galactic
module.
It defines helper classes.
- class Factory
The
Factory
class is used to register classes.- register(name: str, cls: type) None
Register a new class.
- Parameters:
name (str) – The registered name
cls – The class
- get(name: str) type
Get a class from its name.
- Parameters:
name (str) – The registered name
- Return type:
The class
- create(name: str, *args: Any, **kwargs: Any) Any
Create an instance of a class given its registered name.
- class Resource(label: str = '', explanation: str = '')
The
Resource
class represents informationn given by the data analyst.It is designed to be mutable until the
hash()
function has been applied.New in version 0.5.0.
- detect_plugins(group: str = 'py_galactic_extension', name: Optional[str] = None) None
Detect plugins.
- add_yaml_class(tag: str, cls: Any, arguments: Optional[str] = None, params: Optional[List[str]] = None) None
Add a YAML class.
This function calls the
add_yaml_constructor()
function and theadd_yaml_representer()
function.- Parameters:
- Keyword Arguments:
Deprecated since version 0.5.0: Use the
galactic.yaml.YamlObject
class
- add_yaml_constructor(tag: str, cls: Any) None
Add a YAML constructor.
Deprecated since version 0.5.0: Use the
galactic.yaml.YamlObject
class
- add_yaml_representer(tag: str, cls: Any, arguments: Optional[str] = None, params: Optional[List[str]] = None) None
Add a YAML representer.
- Parameters:
- Keyword Arguments:
Deprecated since version 0.5.0: Use the
galactic.yaml.YamlObject
class