Module k.datatypes

Part of kiwi

Data type converters with locale and currency support.

Provides routines for converting data to and from strings. Simple example:

>>> from kiwi.datatypes import converter
>>> converter.from_string(int, '1,234')
'1234'
>>> converter.from_string(float, '1,234')
'1234.0'
>>> converter.to_string(currency, currency('10.5'))
'$10.50'
ClassDecimalUndocumented
FunctionGetLocaleInfo 0Undocumented
FunctionGetLocaleInfoUndocumented
ClassValidationErrorUndocumented
ClassConverterRegistryUndocumented
ClassBaseConverter

Abstract converter used by all datatypes

Class_StringConverterUndocumented
Class_UnicodeConverterUndocumented
Class_IntConverterUndocumented
Class_LongConverterUndocumented
Class_BoolConverterUndocumented
Class_FloatConverterUndocumented
Class_DecimalConverterUndocumented
Class_BaseDateTimeConverter

Abstract class for converting datatime objects to and from strings

Class_TimeConverterUndocumented
Class_DateTimeConverterUndocumented
Class_DateConverterUndocumented
Class_ObjectConverterUndocumented
Class_EnumConverterUndocumented
Functionlformat

Like locale.format but with grouping enabled

Functionget_localeconvUndocumented
Functionfilter_locale

Removes the locale specific data from the value string.

def GetLocaleInfo 0(value):
Undocumented
def GetLocaleInfo(value):
Undocumented
def lformat(format, value):

Like locale.format but with grouping enabled

def get_localeconv():
Undocumented
def filter_locale(value, monetary=False):

Removes the locale specific data from the value string. Currently we only remove the thousands separator and convert the decimal point. The returned value of this function can safely be passed to float()