:py:mod:`core.utils.parse` ========================== .. py:module:: core.utils.parse .. autoapi-nested-parse:: ViUR utility functions regarding parsing. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: core.utils.parse.bool core.utils.parse.timedelta .. py:function:: bool(value, truthy_values = ('true', 'yes', '1')) Parse a value into a boolean based on accepted truthy values. This method takes a value, converts it to a lowercase string, removes whitespace, and checks if it matches any of the provided truthy values. :param value: The value to be parsed into a boolean. :param truthy_values: An iterable of strings representing truthy values. Default is ("true", "yes", "1"). :returns: True if the value matches any of the truthy values, False otherwise. .. py:function:: timedelta(value) Parse a value into a timedelta object. This method takes a seconds value and converts it into a timedelta object, if it is not already one. :param value: The value to be parsed into a timedelta. :returns: A timedelta object.