Package: ofxstatement-sparkasse-freiburg
ofxstatement plugin for Sparkasse Freiburg-Nördlicher BreisgauThis is an ofxstatement plugin for the German bank Sparkasse
Freiburg-Nördlicher Breisgau (short: Sparkasse Freiburg).This plugin has no affiliation with or endorsement bySparkasse
Freiburg-Nördlicher Breisgau. The only
reason for using the name is to aid people looking for a tool to convert that
bank's CSV transaction exports to OFX.ofxstatementis a tool to convert
proprietary bank statement to OFX format, suitable for importing to GnuCash.
Plugin for ofxstatement parses a particular proprietary bank statement format
and produces common data structure, that is then formatted into an OFX file.Users of ofxstatement have developed several plugins for their banks. They are
listed on the mainofxstatementsite.
If your bank is missing, you can develop your own plugin.UsageTo use this plugin install it. For example:pip3install--userofxstatement-sparkasse-freiburgEdit the configuration:ofxstatementedit-configAdd something like this:[sparkasse_freiburg]
plugin = germany_sparkasse_freiburg
account = 123456789accountis you bank account number (Kontonummer).Other possible settings are:encoding:The encoding of the CSV file (default is Windows 1252 ANSI:
cp1252)Then download the CSV files (CSV-CAMT format) from you online banking account
and convert it as follows:ofxstatementconvert-tsparkasse_freiburgEXAMPLE.csvEXAMPLE.ofxThe resulting .ofx file can then be imported in gnuCash or similar software.Note:Beware that some things (such as balance calculation) were left out
because they are not needed by gnuCash. Open a ticket or send a pull request if
something is missing for your use case.DevelopmentIt is recommended to usevirtualenvto make a clean development environment.gitclonehttps://github.com/omarkohl/ofxstatement-sparkasse-freiburgcdofxstatement-sparkasse-freiburg
makevenvsource.venv/bin/activateThis will download all the dependencies and install them into your virtual
environment. After this, you should be able to do::ofxstatementlist-pluginsExpected output:The following plugins are available:

  germany_sparkasse_freiburg Plugin for German bank Sparkasse FreiburgTestsExecute:maketestIntegration testsPart of the tests are integration (or end to end) tests that test the complete
conversion from CSV to OFX files. You can find these files undertests/data.
Every.csvfile is verified to be converted to the corresponding.ofxfile.
Additionally the-pretty.xmlfiles contain a pretty version of the resulting
OFX (which actually is just XML).To add a new .csv example simply include it in said directory and edittests/test_integration.py. SetOVERWRITE_EXPECTED_FILEStoTrueand then
execute the tests. Commit the content oftests/data.Since unfortunately theofxstatementconfig is a global file with no option
to pass in another path the integration tests overwrite this file before each
test and then restore it. This is done using apytestfixture. Running
integration tests and any otherofxstatementoperation at the same time with
the same user on the same system is therefore a bad idea.ImprovementsIn general the plugin tries to be simple and not convert any values that are
currently not needed. If something is missing feel free to open an issue or
even better send a pull requests.Some things which may be worth modifying:The bank_id is currently hardcoded to Sparkasse Freiburg's BICThe currency of the account is also hardcoded to EURThe StatementLine.id (becomes OFX's FITID) is calculated by hashing date,
payee, memo and amount and then truncated. FITID should always be unique for
the entire account history to detect transaction duplicates.OFX's NAME field (.payee in the code) is made out of the sender/receiver +
the subject (Verwendungszweck). This could be made configurable.OFX's MEMO field (.memo in the code) is made out of Buchungstext, Kontonummer
and BIC.trntype is currently only ever set to DEBIT or CREDIT. Using 'Buchungstext'
it could be improved.