csb43.formats¶
-
formats.FORMATS= [u'xlsx', u'ods', u'yaml', u'json', u'html', u'tsv', u'csv', u'xls']¶
-
formats.TABLIB_FORMATS= [u'json', u'xls', u'yaml', u'csv', u'tsv', u'html', u'xlsx', u'ods']¶
-
formats.DICT_FORMATS= [u'json', u'yaml']¶
-
csb43.formats.convertFromCsb(csb, expectedFormat)¶ Convert a File file into an
tablibdata object or a dictionary-like objectParameters: csb ( csb43.csb43.File) – a csb fileReturn type: tablib.Databook,tablib.Datasetor a object with an attribute named as expectedFormat
-
csb43.formats.convertFromCsb2Dict(csb, expectedFormat=u'json')¶ Convert from CSB43 to a dictionary format
Parameters: csb ( csb43.csb43.File) – a csb fileReturn 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": []}
-
csb43.formats.convertFromCsb2Tabular(csb, expectedFormat=u'ods')¶ Convert a File file into an
tablibdata objectParameters: csb ( csb43.csb43.File) – a csb fileReturn type: tablib.Databookortablib.Dataset