Package: beancount-dkb
Beancount DKB Importerbeancount-dkbprovides an Importer for converting CSV exports ofDKB(Deutsche Kreditbank) account summaries to theBeancountformat.Installation$pipinstallbeancount-dkbIn case you prefer installing from the Github repository, please note thatmainis the development branch sostableis what you should be installing
from.UsageIf you're not familiar with how to import external data into Beancount, please
readthis guidefirst.Adjust yourconfig fileto includeECImporterandCreditImporter(depending on what account you're trying to import).A sample configuration might look like the following:frombeancount_dkbimportECImporter,CreditImporterIBAN_NUMBER='DE99 9999 9999 9999 9999 99'# your real IBAN numberCARD_NUMBER='9999 9999 9999 9999'# your real Credit Card numberCONFIG=[ECImporter(IBAN_NUMBER,'Assets:DKB:EC',currency='EUR',),CreditImporter(CARD_NUMBER,'Assets:DKB:Credit',currency='EUR',)]Once this is in place, you should be able to runbean-extracton the command
line to extract the transactions and pipe all of them into your Beancount file.$bean-extract/path/to/config.pytransaction.csv>>you.beancountTransaction Codes as Meta TagsBy default, the ECImporter prepends the transaction code ("Buchungstext") to the
transaction description. To achieve shorter descriptions and use meta tags to
query for certain transaction codes, the importer may be configured to store the
transaction code in a user provided meta tag.The following configuration instructs the importer to use a meta tagcodeto
store transaction codes:...CONFIG=[ECImporter(IBAN_NUMBER,'Assets:DKB:EC',currency='EUR',meta_code='code',),...This is how an example transaction looks without the option:2021-03-01 * "Kartenzahlung" "XY Supermarket"
    Assets:DKB:EC                        -133.72 EURAnd this is the resulting transaction usingmeta_code='code'2021-03-01 * "XY Supermarket"
    code: Kartenzahlung
    Assets:DKB:EC                        -133.72 EURPattern-matching TransactionsIt's possible to give the importer classes hints if you'd like them to include a
second posting based on specific characteristics of the original transaction.For instance, if the payee or the description in a transaction always matches a
certain value, it's possible to tell theECImporterorCreditImporterto
automatically place a second posting in the returned lits of transactions.ECImporterECImporteraccepts apayee_patternsargument, which should be a list of(pattern, account)tuples.CONFIG=[ECImporter(IBAN_NUMBER,'Assets:DKB:EC',currency='EUR',payee_patterns=[('REWE Filialen','Expenses:Supermarket:REWE'),('NETFLIX','Expenses:Online:Netflix'),],),CreditImporterCreditImporteraccepts adescription_patternsargument, which should be a
list of(pattern, account)tuples.CONFIG=[CreditImporter(CARD_NUMBER,'Assets:DKB:Credit',currency='EUR',description_patterns=[('REWE sagt Danke','Expenses:Supermarket:REWE'),('NETFLIX','Expenses:Online:Netflix'),],)ContributingContributions are most welcome!Please make sure you have Python 3.8+ andPoetryinstalled.Clone the repository:git clone https://github.com/siddhantgoel/beancount-dkbInstall the packages required for development:poetry installThat's basically it. You should now be able to run the test suite:poetry run py.test.