API Documentation¶
Class List¶
factoryobject.FactoryObject |
Objects identified by name |
factoryobject.ObjectList |
|
linkedobject.LinkedObject |
links from linked_obj to (obj, attribute) with obj.attribute = linked_obj |
persistentobject.PersistentObject |
|
persistentobject.AttributeList |
object list class |
datarange.DataRange |
|
visibleobject.VisibleObject |
|
visibleobject.VisibleObjectList |
|
visibleobject.VisibleAttributeList |
|
visibleobject.VisibleDataRange |
|
session.SessionHandler |
api session handler for multiprocessing sessions |
Inheritance Diagram¶
Visible Objects¶
-
class
unicum.visibleobject.
VisibleObject
(*args, **kwargs)[source]¶ Bases:
unicum.factoryobject.FactoryObject
,unicum.linkedobject.LinkedObject
,unicum.persistentobject.PersistentObject
-
classmethod
from_serializable
(item, register_flag=False)[source]¶ core class method to create visible objects from a dictionary
-
classmethod
-
class
unicum.visibleobject.
VisibleObjectList
(iterable=None, object_type=<class 'unicum.visibleobject.VisibleObject'>)[source]¶ Bases:
unicum.factoryobject.ObjectList
,unicum.visibleobject.VisibleList
-
class
unicum.visibleobject.
VisibleAttributeList
(iterable=None, object_type=<class 'unicum.visibleobject.VisibleObject'>, value_types=(<class 'float'>, <class 'int'>, <class 'str'>, <class 'NoneType'>, <class 'unicum.visibleobject.VisibleObject'>))[source]¶ Bases:
unicum.persistentobject.AttributeList
,unicum.visibleobject.VisibleList
-
class
unicum.visibleobject.
VisibleDataRange
(iterable=None, value_types=(<class 'float'>, <class 'int'>, <class 'str'>, <class 'NoneType'>, <class 'unicum.visibleobject.VisibleObject'>), none_alias=(None, ' ', '', 'None'))[source]¶ Bases:
unicum.datarange.DataRange
SessionHandler¶
-
class
unicum.session.
SessionHandler
(pkg_name='unicum', cls_name='VisibleObject', cast_types={})[source]¶ Bases:
object
api session handler for multiprocessing sessions
Parameters: - pkg_name – module containing relevant classes
- cls_name – default class (inherited from unicum.VisibleObject)
- types – additional dict of types to cast arguments
Standard type conversion is following a naming convention. So if an arguments ends with int the value will be casted with the type
int
given as value to the key int in types.Same with number, year, month, day and long. Similar we cast float and value to a
float
, string, str and name to astr
as well as bool and flag tobool
Anything ending with variant would be ignored.
And finally, the value of cls will be replaced by an attribute of pkg_name of the same name and the value of self will be replaced by an cls_name instance.
Base Objects¶
Factory Objects¶
-
class
unicum.factoryobject.
FactoryObject
(*args, **kwargs)[source]¶ Bases:
object
Objects identified by name
Linked Objects¶
Persistent Objects¶
-
class
unicum.persistentobject.
PersistentObject
(*args, **kwargs)[source]¶ Bases:
object
-
STARTS_WITH
= '_'¶
-
ENDS_WITH
= '_'¶
-
JSON_INDENT
= 2¶
-
is_modified
¶
-
classmethod
from_serializable
(object_dict)[source]¶ core class method to create visible objects from a dictionary
-
modify_object
(property_name, property_value_variant=None)[source]¶ api visible method for modifying visible object properties
Parameters: - property_name (string, list or dict) – property name
- property_value_variant (various or None) – property value, must be None if property_name is of type dict
Returns: modified object
Return type: unicum.lfojbect.VisibleObject
-
-
class
unicum.persistentobject.
AttributeList
(iterable=None, object_type=<class 'unicum.persistentobject.PersistentObject'>, value_types=(<class 'float'>, <class 'int'>, <class 'str'>, <class 'NoneType'>))[source]¶ Bases:
list
object list class
DataRange Object¶
-
class
unicum.datarange.
DataRange
(iterable=None, value_types=(<class 'float'>, <class 'int'>, <class 'str'>, <class 'NoneType'>), none_alias=(None, ' ', '', 'None'), **kwargs)[source]¶ Bases:
object
-
row_append
(row_key, value_list)[source]¶ append a new row to a DataRange
Parameters: - row_key – a string
- value_list – a list
-
col_append
(col_key, value_list)[source]¶ append a new row to a DataRange
Parameters: - row_key – a string
- value_list – a list
-
item_list
¶
-
total_list
¶
-