CoreData¶
DataCore¶
-
class
panda_core_data.
DataCore
(*args, name=None, replace=False, **kwargs)¶ Bases:
panda_core_data.data_core_bases.data_model.DataModel
,panda_core_data.data_core_bases.data_template.DataTemplate
Class where everything is kept.
-
__call__
(mods_path, **kwargs)¶ Automatically import all data types based on the paths in the params.
Parameters: - mods_path (str) – Absolute root folder to the root mods folder
- core_mod_folder (str) – Name of the core mod folder. The base mod.
- raws_folder (str) – Name of the raw folder.
- models_folder (str) – Name of the models folder.
- templates_folder (bool or str) – Name of the templates folder.
- raw_models_folder (str or bool) – Name of the raws that are related to the models. Default is ‘models_folder’ param.
- raw_templates_folder (str or bool) – Name of the raws that are related to the templates. Default is the ‘templates_folder’ param
Raises: PCDFolderNotFound – If any of the folders are invalid.
-
DataTemplate¶
-
class
panda_core_data.data_core_bases.data_template.
DataTemplate
(*args, **kwargs)¶ Bases:
panda_core_data.data_core_bases.base_data.BaseData
-
all_template_instances
¶ Gets all the template instances
Yield Template: returns a generator of all instanced templates.
-
all_templates
¶ Get all
Template
typesReturn list(Template): return a list of template types.
-
get_template_type
(template_name, **kwargs)¶ Get Data type from a list of all
Template
types.Parameters: Return Template: the
Template
-
DataModel¶
-
class
panda_core_data.data_core_bases.data_model.
DataModel
(*args, **kwargs)¶ Bases:
panda_core_data.data_core_bases.base_data.BaseData
-
all_model_instances
¶ Gets all the model instances.
Yield Model: returns a generator of all instanced templates.
-
all_models
¶ Get all
Model
typesReturn list(Model): return a list of model types.
-
get_model_type
(model_name: str, **kwargs)¶ Get Data type from a list of all
Model
types.Parameters: Return Model: the
Model
-
BaseData¶
-
class
panda_core_data.data_core_bases.base_data.
BaseData
(excluded_extensions=False)¶ -
classmethod
__init_subclass__
()¶ This function checks if a method is lacking inside any class that inherits this, and also automatically creates docstrings into those methods based on the original method.
Parameters: cls (DataType) – Child class
-
add_module
(path)¶ Automatically import the module from the python file and add it’s directory to sys.path if it wasn’t in there before.
Parameters: path (Path or str) – The path to the python file. Return module: Returns the imported module.
-
static
all_datas
()¶ Get all
DataType
typesReturn list(DataType): return a list of data types.
-
static
get_data_type
(data_name, data_dict, default=None)¶ Get Data type from a list of all
DataType
types.Parameters: Return DataType: the
DataType
-
classmethod