Dict Parser

Schema on Site

 This component allows for a custom Dict to Table performance.


Methods:
    def AddDict(data: dict, unique=True):
        """Add a dict to be parsed."""
        pass

    def AddDicts(data: List[dict], unique=True):
        """Add a List of Dicts to be parse."""
        pass

    def GetItem(itemId:str, rows = "*") -> dict:
        """
            Get a single items as a dict.
        """

    def DeleteItem(itemId:str):
        """
            Delete an item based on the ID. Returns True or False depending of success.
        """

    def SearchItems(key = lambda value: True, rows = "*") -> List[Dict]:
        """
            Search Items in the table based on the key-function returning true or false.
            Use rows arguments to filter returned data.
        """

    def SortTable(key = lambda row: row[0], reverse = False) -> bool:
        """
            Sorts the table based on the key-function. This works on the table
            holding the data and does not change the data.
        """


Callbacks:
def GetDefinition( entryDefinition:"Type[EntryDefinition]", parser:"extDictParser" ):
	return [
		entryDefinition( "Required", lambda input: input["Required"], required = True, returnFunction=lambda value: value.capitalize() ),
		entryDefinition( "NoDefault", lambda input: input["NoDefault"] ),
		entryDefinition( "NotRequired", lambda input: input["NotRquired"], default = "Default Value")
	]


Downloads: 95

Created at: 5.6.2024

Uploaded: 3.8.2024
Changes to the API and inner workings. Keeping older API arround for backwards compatibility.
All in All more akin to a database now.
Download