Biryani is a Python toolbox to convert and validate values (for web forms, etc).
Package Documentation
Requirements:
· Python
What's New in This Release: [ read full changelog ]
· Rework boolean converters. New biryani.baseconv.guess_bool() converter. Remove form_data_to_bool converter.
· Rename converter require to biryani.baseconv.test_exists().
This new name is more consistent with other test_... converters. It is also more clear when used in a condition test. For example:
· conv.condition(
· conv.test_exists,
· conv.set_value('Value exists'),
· conv.set_value('Value is missing'),
· )
· New biryani.baseconv.struct() converter that replaces both biryani.baseconv.structured_mapping() & biryani.baseconv.structured_sequence() converter.
· Replace mapping and “sequence`` converters with biryani.baseconv.new_struct() (and biryani.baseconv.new_mapping() and biryani.baseconv.new_sequence()).
· Add biryani.baseconv.get() converter.
· New biryani.baseconv.str_to_url_path_and_query() converter.
· Rename parameters keep_null_items & keep_null_keys used by mappings or sequences converters to keep_missing_items & keep_missing_keys.
· Add optional state to biryani.baseconv.function() and biryani.baseconv.test() converters.
· Rename handle_none parameter of biryani.baseconv.function() and biryani.baseconv.test() converters to handle_missing_value.
· Rename function to_value to biryani.baseconv.check() and extend it to accept either a converter or a conversion result as argument.
· New function biryani.custom_conv() to import only needed conversion modules.
· Function biryani.strings.slugify() now always returns unicode.
· Rename dict_to_instance converter to biryani.objectconv.dict_to_object() and move it to module biryani.objectconv.
· Remove converters in biryani.objectconv that were duplicates of biryani.datetimeconv.
· New module biryani.creditcardconv.
· Remove module pymongoconv.
· This module was related to Monpyjama instead of pymongo and its converters are no more used.
· Rename module sugar.sweetbaseconv to biryani.nonstandard.deprecatedbaseconv.
· New experimental converter biryani.nonstandard.experimentalbaseconv.mapping_replace_sequence().
· Add internationalization support and French localization.
· Complete documentation and tests.