def getTypedValue(data_type, value):

    if data_type == 'boolean':
        return bool(value)
    elif data_type == 'integer':
        return int(value)
    elif data_type == 'float':
        return float(value)
    elif data_type == 'string':
        return str(value)
    else:
        return value # no type casting
Utility function to cast a string value to the appropriate XSD type.
dataset/ETHPy150Open geopython/OWSLib/owslib/util.py/getTypedValue