Package: csb43
EspañolHerramientas para convertir ficheros en formato usado por múltiples
bancos españoles (norma 43 del Consejo Superior Bancario[CSB43]
/Asociación Española de Banca[AEB43]) a otros formatos.csb2formatConversor de ficheros enCSB/AEB norma 43a otros formatos.Formatos soportados:OFX XMLv1.0.3 & v2.1.1HomeBank CSVHTMLJSONODS: hoja de cálculo OpenDocumentCSV,TSV: valores separados por coma o tabuladorXLS: hoja de cálculo de Microsoft ExcelXLSX: hoja de cálculo OOXMLYAMLInstalación:Todos los formatos disponibles:pip install csb43[all]Formatos internos (ofx, ofx1, homebank) más YAML:pip install csb43[yaml]Formatos internos (ofx, ofx1, homebank) más formatos del paquetetablib:pip install csb43[formats]Opciones:usage: csb2format [-h] [-s] [-df] [-d DECIMAL] [-e ENCODING] [--use-float]
                [-V]
                [-f {csv,dbf,df,homebank,html,json,latex,ods,ofx,ofx1,tsv,xls,xlsx,yaml}]
                [-v]
                csbFile convertedFile

Convierte un fichero CSB43 a otro formato

optional arguments:
-h, --help            show this help message and exit
-v, --version         show program's version number and exit

csb43 arguments:
csbFile               fichero csb43 ('-' para entrada estándar)
-s, --strict          modo estricto (por defecto: False)
-df, --dayfirst       usa DDMMYY -día, mes, año- como formato de fecha al
                        interpretar los datos del fichero csb43 en lugar de
                        YYMMDD -año, mes, día- (por defecto: True)
-d DECIMAL, --decimal DECIMAL
                        establece el número de dígitos decimales a considerar
                        en el tipo de divisa (por defecto: 2)
-e ENCODING, --encoding ENCODING
                        establece la codificación de entrada ('cp850' para
                        fichero AEB estándar, por defecto: 'latin1')
--use-float           exporta cantidades monetarias usando números binarios
                        en punto flotante como último recurso (default: False)
-V, --verbose         mostrar avisos de csb43

output arguments:
convertedFile         fichero de destino ('-' para salida estándar)
-f {csv,dbf,df,homebank,html,json,latex,ods,ofx,ofx1,tsv,xls,xlsx,yaml}, --format {csv,dbf,df,homebank,html,json,latex,ods,ofx,ofx1,tsv,xls,xlsx,yaml}
                    Formato del fichero de salida (por defecto: ofx)EjemplosConvertir a formato OFX:$ csb2format transactions.csb transactions.ofx

$ csb2format --format ofx transactions.csb transactions.ofxo bien$ csb2format transactions.csb - > transactions.ofxDesde una aplicación de recuperación de datos a otro fichero$ get_my_CSB_transactions | csb2format - transactions.ofxConvertir a hoja de cálculo XLSX (Excel):$ csb2format --format xlsx transactions.csb transactions.xlsxUsando cp850 como codificación de entrada:$ csb2format --encoding cp850 --format xlsx transactions.csb transactions.xlsxHojas de cálculoLos ficheros enODS,XLSyXLSXse generan a modo de libro, conteniendo
la primera hoja la información relativa a las cuentas, y las hojas
siguientes conteniendo cada una los movimientos de cada cuenta.En PythonLee un archivoCSB43e imprime el contenido equivalente enOFX:::python

# OFX
from csb43.ofx import converter as ofx_converter
from csb43.csb43 import File

csbFile = File(open("movimientos.csb", "rb"), strict=False)

# imprime a stdout
print(ofx_converter.convertFromCsb(csbFile))Lee un archivoCSBe imprime el contenido equivalente aCSVdeHomebank:::python

# Homebank
from csb43.homebank import converter as hbk_converter
from csb43.csb43 import File

csbFile = File(open("movimientos.csb", "rb"), strict=False)

# imprime a stdout
for line in hbk_converter.convertFromCsb(csbFile):
    print(line)Lee un archivoCSBe imprime el equivalente en un archivo de formato
tabular o de diccionario:::python

from csb43 import csb43, formats

csbFile = csb43.File(open("movimientos.csb", "rb"), strict=False)

# imprime formato 'yaml' a stdout
o = formats.convertFromCsb(csbFile, 'yaml')
print(o.yaml)

# escribe a archivo en formato 'xlsx'
o = formats.convertFromCsb(csbFile, 'xlsx')
with open("movimientos.xlsx", "wb") as f:
    f.write(o.xlsx)EnglishTools for converting from the Spanish banks’ formatCSB norm 43(CSB43).csb2formatConvert aCSB/AEB norm 43file to other file formats.Supported formats:OFX v1.0.3 (SGML) & v2.1.1 (XML)HomeBank CSVHTMLJSONODS: OpenDocument spreadsheetCSV,TSV: comma- or tab- separated valuesXLS: Microsoft Excel spreadsheetXLSX: OOXML spreadsheetYAMLInstalling:All the available formats:pip install csb43[all]Built-in formats (ofx, ofx1, homebank) plus YAML:pip install csb43[yaml]Built-in formats (ofx, ofx1, homebank) plus formats provided by the packagetablib:pip install csb43[formats]If you don’t need all the formats supported by tablib, you can use;pip install csb43[basic_formats]Options:usage: csb2format [-h] [-s] [-df] [-d DECIMAL] [-e ENCODING] [--use-float]
                 [-V]
                 [-f {csv,dbf,df,homebank,html,json,latex,ods,ofx,ofx1,tsv,xls,xlsx,yaml}]
                 [-v]
                 csbFile convertedFile

Convert a CSB43 file to another format

optional arguments:
-h, --help            show this help message and exit
-v, --version         show program's version number and exit

csb43 arguments:
csbFile               a csb43 file ('-' for stdin)
-s, --strict          strict mode (default: False)
-df, --dayfirst       use DDMMYY as date format while parsing the csb43 file
                        instead of YYMMDD (default: True)
-d DECIMAL, --decimal DECIMAL
                        set the number of decimal places for the currency type
                        (default: 2)
-e ENCODING, --encoding ENCODING
                        set the input encoding ('cp850' for standard AEB file,
                        default: 'latin1')
--use-float           export monetary amounts using binary floating point
                        numbers as a fallback (default: False)
-V, --verbose         show csb43 warnings

output arguments:
convertedFile         destination file ('-' for stdout)
-f {csv,dbf,df,homebank,html,json,latex,ods,ofx,ofx1,tsv,xls,xlsx,yaml}, --format {csv,dbf,df,homebank,html,json,latex,ods,ofx,ofx1,tsv,xls,xlsx,yaml}
                        Format of the output file (default: ofx)ExamplesConverting to OFX format:$ csb2format transactions.csb transactions.ofx

$ csb2format --format ofx transactions.csb transactions.ofxor$ csb2format transactions.csb - > transactions.ofxFrom another app to file$ get_my_CSB_transactions | csb2format - transactions.ofxConverting to XLSX spreadsheet format:$ csb2format --format xlsx transactions.csb transactions.xlsxUsing cp850 as the input encoding:$ csb2format --encoding cp850 --format xlsx transactions.csb transactions.xlsxSpreadsheetsODS,XLSandXLSXfiles are generated as books, with the first sheet
containing the accounts information, and the subsequent sheets
containing the transactions of each one of the accounts.Using PythonParse aCSB43file and print the equivalentOFXfile:::python

# OFX
from csb43.ofx import converter as ofx_converter
from csb43.csb43 import File

csbFile = File(open("movimientos.csb", "rb"), strict=False)

# print to stdout
print(ofx_converter.convertFromCsb(csbFile))Parse aCSB43file and print the equivalentHomeBank CSVfile:::python
# Homebank
from csb43.homebank import converter as hbk_converter
from csb43.csb43 import File

csbFile = File(open("movimientos.csb", "rb"), strict=False)

# print to stdout
for line in hbk_converter.convertFromCsb(csbFile):
    print(line)Parse aCSB43file and print the equivalent in a tabular or
dictionary-like file format:::python

from csb43 import csb43, formats

csbFile = csb43.File(open("movimientos.csb", "rb"), strict=False)

# print 'yaml' format to stdout
o = formats.convertFromCsb(csbFile, 'yaml')
print(o.yaml)

# write 'xlsx' format to file
o = formats.convertFromCsb(csbFile, 'xlsx')
with open("movimientos.xlsx", "wb") as f:
    f.write(o.xlsx)InstalaciónUsandopip$ pip install csb43InstallingUsingpip$ pip install csb43Changelog0.9.3Add support for Python 3.12 (thanks to Cédric Krier)0.9.2Fixed setuptool’s deprecation warning on python==3.10 (thanks to @mb)Fixed duplicated documentation of the same objects by sphinx (thanks to @mb)0.9.1Added python_requires >= 3.6 (thanks to Cédric Krier)0.9.0Dropped support for Python 2 (thanks to Sergi Almacellas)Added support for Python 3.8 and 3.9 (thanks to Sergi Almacellas)Added compatibility with tablib >= 1.0.0 (thanks to Sergi Almacellas)Type hinting0.8.4Fixed tablib requirement (< 1.0.0)Fixed parsing of records with code 00 (thanks to Uttam Sharma)0.8.2Do not fail with C locale (thanks to Cédric Krier)0.8.1Fixed decimal values conversion in JSON and tabular formats (thanks to Harshad Modi).Fixed OFX validation (ORIGCURRENCY field).An error is raised when the currency code is not found.0.8Text values are stored as string instead of bytes (thanks to Sergi Almacellas)Warnings are raised using the ‘warnings’ module.An encoding where control characters are different from ascii is not allowed. An exception will be raised.csb2format: added encoding as a new parameter.0.7Defined installation targets:yamlandformats(thanks to Sergi Almacellas & Cédric Krier).Updated README file (thanks to Sergi Almacellas).Removedsimplejsondependency.Dates stored asdateinstead ofdatetime(thanks to Sergi Almacellas).Monetary amounts are represented asDecimalinstead tofloatin order to prevent representation and rounding issues. These fields are exported as a string by default, conversion to float is optional (thanks to Sergi Almacellas & Cédric Krier).Added temprary dependency toopenpyxl < 2.5.0to prevent issue while trying to export to xlsx.0.6Fixed usage of pycountry >= 16.10.23rc1 objects (thanks to Alex Barcelo).Package refactored to simplify the structure.0.5Fixed conversion to binary formats in python 2.tablibbackend supported in python 3.N43 warnings are silenced by default.0.4OFX v 1.0.3 supported.OFX Tag inv401source renamed to inv401ksource.Unique transaction id when generating OFX file (thanks to Julien Moutte).0.3.4Most Spanish N43 files will use LATIN-1 encoding not pure ASCII (thanks to Julien Moutte).Regular expression to check for account name is too limited (thanks to Julien Moutte).Reference1 can hold non numerical data in information mode 1 and 2 (thanks to Julien Moutte).Currency data as an inmutable list.0.3.3Fixed deficiencies in OFX conversion (thanks to Andrea Santambrogio). Checked XML validation against OFX2_Protocol.xsd0.3Compatible with Python 3 (except “tablib” dependencies)0.2.3Fixed shebang header of csb2format0.2.2csb2format adapted to pyinstallerExecutable file for Windows0.2.1Trivial changes0.2Several bugfixesBidirectional use of objects (file -> object, object -> file)Added conversion to spreadsheets, dict and tabular formats (thanks to tablib)Localization to SpanishSphinx documentation0.1Initial release