csb43.formats¶
-
csb43.formats.DICT_FORMATS= [u'json', u'yaml']¶ dictionary formats
-
csb43.formats.FORMATS= ['latex', 'xlsx', 'ods', 'dbf', 'yaml', 'json', 'html', 'tsv', 'csv', 'xls']¶ available formats
-
exception
csb43.formats.FormatWarning¶
-
csb43.formats.TABLIB_FORMATS= ['json', 'xls', 'yaml', 'csv', 'dbf', 'tsv', 'html', 'latex', 'xlsx', 'ods']¶ formats supported by
tablib
-
csb43.formats.convertFromCsb(csb, expectedFormat, decimal_fallback=None)¶ Convert a File file into an
tablibdata object or a dictionary-like objectParameters: - csb (
csb43.csb43.File) – a csb file - decimal_fallback – decimal number fallback representation:
- ‘float’: use type float
- ‘str’: represent decimal as a string
- None: use default fallback (‘str’)
Return type: tablib.Databook,tablib.Datasetor a object with an attribute named as expectedFormat- csb (
-
csb43.formats.convertFromCsb2Dict(csb, expectedFormat=u'json', decimal_fallback=None)¶ Convert from CSB43 to a dictionary format
Parameters: - csb (
csb43.csb43.File) – a csb file - decimal_fallback – decimal number fallback representation
Return type: a object with an attribute named as expectedFormat
Raises: csb43.utils.Csb43Exceptionwhen the format is unknown or unsupported>>> from csb43.csb43 import File >>> import csb43.formats as formats >>> f = File() >>> o = formats.convertFromCsb2Dict(f, 'yaml') >>> print(o.yaml) cuentas: []
>>> o = formats.convertFromCsb2Dict(f, 'json') >>> print(o.json) { "cuentas": [] }
- csb (
-
csb43.formats.convertFromCsb2Tabular(csb, expectedFormat=u'ods', decimal_fallback=None)¶ Convert a File file into an
tablibdata objectParameters: - csb (
csb43.csb43.File) – a csb file - decimal_fallback – decimal number fallback representation
Return type: tablib.Databookortablib.Dataset- csb (
-
formats.FORMATS= ['latex', 'xlsx', 'ods', 'dbf', 'yaml', 'json', 'html', 'tsv', 'csv', 'xls']
-
formats.TABLIB_FORMATS= ['json', 'xls', 'yaml', 'csv', 'dbf', 'tsv', 'html', 'latex', 'xlsx', 'ods']
-
formats.DICT_FORMATS= [u'json', u'yaml']
-
csb43.formats.convertFromCsb(csb, expectedFormat, decimal_fallback=None) Convert a File file into an
tablibdata object or a dictionary-like objectParameters: - csb (
csb43.csb43.File) – a csb file - decimal_fallback – decimal number fallback representation:
- ‘float’: use type float
- ‘str’: represent decimal as a string
- None: use default fallback (‘str’)
Return type: tablib.Databook,tablib.Datasetor a object with an attribute named as expectedFormat- csb (
-
csb43.formats.convertFromCsb2Dict(csb, expectedFormat=u'json', decimal_fallback=None) Convert from CSB43 to a dictionary format
Parameters: - csb (
csb43.csb43.File) – a csb file - decimal_fallback – decimal number fallback representation
Return type: a object with an attribute named as expectedFormat
Raises: csb43.utils.Csb43Exceptionwhen the format is unknown or unsupported>>> from csb43.csb43 import File >>> import csb43.formats as formats >>> f = File() >>> o = formats.convertFromCsb2Dict(f, 'yaml') >>> print(o.yaml) cuentas: []
>>> o = formats.convertFromCsb2Dict(f, 'json') >>> print(o.json) { "cuentas": [] }
- csb (
-
csb43.formats.convertFromCsb2Tabular(csb, expectedFormat=u'ods', decimal_fallback=None) Convert a File file into an
tablibdata objectParameters: - csb (
csb43.csb43.File) – a csb file - decimal_fallback – decimal number fallback representation
Return type: tablib.Databookortablib.Dataset- csb (