Dict Model

Parsing is always the hardest part.

This component takes a dictionary data-structure and parses it into a nicely usable table.

You can define your model simply using the table of the component. When adjusting the table definition, the output will be cleared, but stays consistent over saves.

  • name: The name of the attribute in the parsed dictionary.
  • path: The expected path in the unparsed dictionary, using . notation. When a list is expected, feed it an integer.
  • default: The value that will be used when the member is not set.
  • required: set to True to throw an exception when the member does not exist.
  • type: used for the Get_Data methods. write int, bool, float etc. to get the correct member returned.
  • parser: define a function that will be executed before the data is saved. Perfect for timestamps.

  1. TableDAT : The parsed table.

  • Clear: Removes all entries from the table.

  • Parse_Dict( dictionary ) -> Dict : Parses the dictionary according to the table and returns it.
  • Write_Dict_To_Table( dictionary ) : Parses the dict and writes it into the table.
  • Write_Dicts_To_Table( [ dictionaries ] ) : Parses the list of dictionaries and writes them all to the table.
  • Get_Data() -> [ parsed_dictionaries] : Returns all saved data as parsed dicts.
  • Get_Row_data( index ) -> parsed_dict : Returns the dictionary of the specified list.

Downloads: 64

Created at: 6.7.2021

Uploaded: 6.7.2021
Initital release.