Package: power-dict
What's the good of that?Validate and transform an incoming dictionary based on schema rulesGet the dictionary value and cast string representation to target data typeAvailable types:"object": raw object"str": textual data"int": integer numeric type"float": float numeric type"decimal": decimal numeric type"list": list sequence type"datetime": a datetime object is a single object containing all the information from a date object and a time object"date": a date object represents a date (year, month and day)"bool": boolean values are the two constant objects False and TrueSet default value if result is NoneGet the required dictionary value and cast it to data typeGet the required dictionary value and raise error if value is emptyinstallpip install power-dictimportfrompower_dict.utilsimportDictUtilsRun unittest from consolepython -m unittest discover -p "*_tests.py"SchemaValidator.validate(context: dict, schema: list, sanitize_schema: bool = True) -> dictValidation and transformation of 'context' dictionary in accordance with the rules of the scheme.See tests for examples.DictUtils.get_value(properties: dict, key: str, **kwargs) -> objectGet the dictionary value and cast it to object.See tests for examples.DictUtils.get_required_value(properties: dict, key: str, **kwargs) -> objectGet the required dictionary value and cast it to object.See tests for examples.DictUtils.get_setting_by_path(properties: dict, path: str, **kwargs) -> objectGet the dictionary value and cast it to object by path.See tests for examples.DictUtils.get_dict_property(properties: dict, key: str, default_value=None) -> objectGet the dictionary value.See tests for examples.DictUtils.get_required_dict_property(properties: dict, key: str, required_error=None) -> objectGet the required dictionary value.See tests for examples.DictUtils.get_str_dict_property(properties: dict, key: str, default_value='') -> strGet the dictionary value and cast it to 'str'.See tests for examples.DictUtils.get_required_str_dict_property(properties: dict, key: str, required_error=None) -> strGet the required dictionary value and cast it to 'str'.See tests for examples.DictUtils.get_int_dict_property(properties: dict, key: str, default_value=None) -> intGet the dictionary value and cast it to 'int'.See tests for examples.DictUtils.get_required_int_dict_property(properties: dict, key: str, required_error=None) -> intGet the required dictionary value and cast it to 'int'.See tests for examples.DictUtils.get_datetime_dict_property(properties: dict, key: str, default_value: datetime = None, format: str = None) -> datetimeGet the dictionary value and cast it to 'datetime'.See tests for examples.Format Codes.DictUtils.get_required_datetime_dict_property(properties: dict, key: str, required_error=None, format: str = None) -> datetimeGet the required dictionary value and cast it to 'datetime'.See tests for examples.Format Codes.DictUtils.get_date_dict_property(properties: dict, key: str, default_value=None, format: str = None) -> datetime.dateGet the dictionary value and cast it to 'date'.See tests for examples.Format Codes.DictUtils.get_required_date_dict_property(properties: dict, key: str, required_error=None, format: str = None) -> datetime.dateGet the required dictionary value and cast it to 'date'.See tests for examples.Format Codes.DictUtils.get_bool_dict_property(properties: dict, key: str, default_value=None) -> boolGet the dictionary value and cast it to 'bool'.See tests for examples.DictUtils.get_required_bool_dict_property(properties: dict, key: str, required_error=None) -> boolGet the required dictionary value and cast it to 'bool'.See tests for examples.DictUtils.get_decimal_dict_property(properties: dict, key: str, default_value=None) -> DecimalGet the dictionary value and cast it to 'decimal'.See tests for examples.DictUtils.get_required_decimal_dict_property(properties: dict, key: str, required_error=None) -> DecimalGet the required dictionary value and cast it to 'decimal'.See tests for examples.DictUtils.get_list_dict_property(properties: dict, key: str, default_value=None) -> listGet the dictionary value and cast it to 'list'.See tests for examples.DictUtils.get_required_list_dict_property(properties: dict, key: str, required_error=None) -> listGet the required dictionary value and cast it to 'list'.See tests for examples.DictUtils.get_float_dict_property(properties: dict, key: str, default_value=None) -> floatGet the dictionary value and cast it to 'float'.See tests for examples.DictUtils.get_required_float_dict_property(properties: dict, key: str, required_error=None) -> floatGet the required dictionary value and cast it to 'float'.See tests for examples.