{"id":16420451,"url":"https://github.com/grindsa/dkb-robo","last_synced_at":"2025-04-08T13:13:17.214Z","repository":{"id":41869003,"uuid":"118286357","full_name":"grindsa/dkb-robo","owner":"grindsa","description":"library to access the internet banking area of  \"Deutsche Kreditbank\" to get account information and transactions","archived":false,"fork":false,"pushed_at":"2024-10-04T08:47:13.000Z","size":654,"stargazers_count":144,"open_issues_count":3,"forks_count":28,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-12T07:28:02.754Z","etag":null,"topics":["deutsche","dkb","kreditbank","mechanize","python","robo","scrap"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grindsa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-20T22:36:02.000Z","updated_at":"2024-10-06T13:34:15.000Z","dependencies_parsed_at":"2023-02-14T14:16:08.170Z","dependency_job_id":"24f30587-d793-4a10-8301-1f665f3ed373","html_url":"https://github.com/grindsa/dkb-robo","commit_stats":{"total_commits":253,"total_committers":13,"mean_commits":19.46153846153846,"dds":"0.055335968379446654","last_synced_commit":"156b38d4bccb4f3f15b1380b923de7f7b0d7d5cc"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grindsa%2Fdkb-robo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grindsa%2Fdkb-robo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grindsa%2Fdkb-robo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grindsa%2Fdkb-robo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grindsa","download_url":"https://codeload.github.com/grindsa/dkb-robo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247847611,"owners_count":21006100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deutsche","dkb","kreditbank","mechanize","python","robo","scrap"],"created_at":"2024-10-11T07:28:03.732Z","updated_at":"2025-04-08T13:13:17.195Z","avatar_url":"https://github.com/grindsa.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable  MD013 --\u003e\n# dkb-robo\n\n![GitHub release](https://img.shields.io/github/release/grindsa/dkb-robo.svg)\n![GitHub last commit (branch)](https://img.shields.io/github/last-commit/grindsa/dkb-robo/master.svg?label=last%20commit%20into%20master)\n![GitHub last commit (branch)](https://img.shields.io/github/last-commit/grindsa/dkb-robo/devel.svg?label=last%20commit%20into%20devel)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/dkb-robo)\n\n[![Codecov main](https://img.shields.io/codecov/c/gh/grindsa/dkb-robo/branch/master?label=test%20coverage%20master)](https://app.codecov.io/gh/grindsa/dkb-robo/branch/master)\n[![Codecov devel](https://img.shields.io/codecov/c/gh/grindsa/dkb-robo/branch/devel?label=test%20coverage%20devel)](https://app.codecov.io/gh/grindsa/dkb-robo/branch/devel)\n\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=grindsa_dkb-robo\u0026metric=security_rating)](https://sonarcloud.io/summary/overall?id=grindsa_dkb-robo)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=grindsa_dkb-robo\u0026metric=sqale_rating)](https://sonarcloud.io/summary/overall?id=grindsa_dkb-robo)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=grindsa_dkb-robo\u0026metric=reliability_rating)](https://sonarcloud.io/summary/overall?id=grindsa_dkb-robo)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=grindsa_dkb-robo\u0026metric=alert_status)](https://sonarcloud.io/summary/overall?id=grindsa_dkb-robo)\n\ndkb-robo is a python library to access the internet banking area of [\"Deutsche Kreditbank\"](https://banking.dkb.de) to fetch\n\n- account information and current balances\n- transactions from creditcards and checking accounts (Girokonten)\n- query the content of \"DKB Postbox\"\n- get standing orders (Dauerauftrag)\n- get information about credit limits and exemption orders (Freistellungsauftrag)\n\nStarting from version 0.9 dkb-robo can handle the 2nd factor DKB introduced to fulfill the [PSD2 obligations](https://en.wikipedia.org/wiki/Payment_Services_Directive). Starting from September 2019 logins must be confirmed by either\n\n- the blue [DKB-Banking app](https://play.google.com/store/apps/details?id=com.dkbcodefactory.banking)\n- Insertion of a TAN created by the [DKB TAN2Go app](https://play.google.com/store/apps/details?id=com.starfinanz.mobile.android.dkbpushtan)\n\nThe introduction of a 2nd factor does limit the usage of dkb-robo for automation purposes. DKB is unfortunately ~~not willing/ not able~~ not allowed to open their PSD2-API for non-Fintechs. I discussed this with them for weeks at some point they stopped responding to my emails so I gave up.\n\nDKB introduced a new web-frontend in July 2023 which is using a REST-API as backend. The migration to the new REST endpoints started with v0.22 and has been completed with v0.27.\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine.\n\n### Prerequisites\n\nTo run dkb-robo on your system you need\n\n- [Python](https://www.python.org)\n- [mechanicalsoup](https://github.com/MechanicalSoup/MechanicalSoup) - Stateful programmatic web browsing library\n- [cookielib](https://docs.python.org/2/library/cookielib.html) - library for Cookie handling for HTTP clients\n- [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/) - a Python library for pulling data out of HTML and XML files.\n\nPlease make sure python and all the above modules had been installed successfully before you start any kind of testing.\n\n### Installing\n\n#### via Pypi\n\n```bash\n\u003e pip install dkb_robo\n```\n\n#### manually for all users\n\n1. download the archive and unpack it\n2. enter the directory and run the setup script\n\n```bash\n\u003e python setup.py install\n```\n\n#### manually for a single user\n\n1. download the archive and unpack it\n2. move the \"dkb_robo\" subfolder into the directory your script is located\n\n#### SBOM\n\n[A bill of material](https://www.linuxfoundation.org/blog/blog/what-is-an-sbom) of the packages coming along wiht `dkb-robo` will be automatically created during build process and stored in [my SBOM respository](https://github.com/grindsa/sbom/tree/main/sbom/dkb-robo)\n\n### Usage\n\nyou need to import dkb-robo into your script\n\n```python\n\u003e from dkb_robo import DKBRobo\n```\n\ncreate a new DKBRobo context handler and login to DKB portal\n\n```python\n\u003e with DKBRobo(dkb_user=\u003clogin username\u003e, dkb_password=\u003cpassword\u003e, chip_tan=True|False|qr, mfa_device=\u003cm|int\u003e, debug=True|False, unfiltered=True|False) as dkb:\n```\n\n- dbk_user: username to access the dkb portal\n- dkb_password: corresponding login password\n- chip_tan: (True/**False**/qr) TAN usage - when not \"False\" dbk-robo will ask for a TAN during login. So far this library only supports [\"chipTAN manuell\" and \"chipTAN QR](https://www.dkb.de/fragen-antworten/was-ist-das-chiptan-verfahren). \"qr\" foces the usage of \"chipTAN QR\" all other values will trigger the usage of \"chipTAN Manuell\"\n- mfa_device: ('m'/Integer) optional - preselect MFA device to be used for 2nd factor - 'm' - main device, otherwise number from device-list\n- debug: (True/**False**) Debug mode\n- unfiltered: (True/**False**) [Unfiltered mode](doc/unfiltered.md)\n\nAfter login you can return a dictionary containing a list of your accounts, the actual balance and a link to fetch the transactions\n\n```python\nfrom pprint import pprint\npprint(dkb.account_dic)\n{0: {\n     'amount': '1458.00',\n     'currencycode': 'EUR',\n     'date': '22.01.2023',\n     'holdername': 'Firstname Lastname',\n     'iban': 'DEXXXXXXXXXXXXXXXXXXXXX',\n     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',\n     'limit': '2500.00',\n     'name': 'Girokonto',\n     'productgroup': 'Meine Konten',\n     'transactions': 'https://banking.dkb.de/api/accounts/accounts/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/transactions',\n     'type': 'account'},\n 1: {\n     'amount': -1000.23,\n     'currencycode': 'EUR',\n     'date': '22.01.2023',\n     'holdername': 'Firstname Lastname',\n     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',\n     'limit': '2000.00',\n     'maskedpan': '1234XXXXXXXX5678',\n     'name': 'Visa CC',\n     'productgroup': 'Meine Konten',\n     'transactions': 'https://banking.dkb.de/api/credit-card/cards/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/transactions',\n     'type': 'creditcard'},\n 2: {\n     'amount': 100000.23,\n     'currencycode': 'EUR',\n     'date': '22.01.2023',\n     'holdername': 'Firstname lastname',\n     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',\n     'limit': '0.00',\n     'maskedpan': '5678XXXXXXXX1234',\n     'name': 'Another Visa',\n     'productgroup': 'Meine Konten',\n     'transactions': 'https://banking.dkb.de/api/credit-card/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/transactions',\n     'type': 'creditcard'},\n 3: {\n     'amount': '123456,79',\n     'currencycode': 'EUR',\n     'holdername': 'Firstname Lastname',\n     'id': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',\n     'name': 'Mein Depot',\n     'productgroup': 'Meine Konten',\n     'transactions': 'https://banking.dkb.de/api/broker/brokerage-accounts/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx(positions?include=instrument%2Cquote',\n     'type': 'depot'}}\n```\n\nto get the list of transactions for a certain checking account or a credit card use the following method\n\n```python\ntlist = dkb.get_transactions(link, type, date_from, date_to)\n```\n\n- link - link to get transactions for a specific account - see former step if you do not know how to get it\n- type - account type (either \"account\" or \"creditcard\") - see former step if you do not know how to get it\n- date_from - start date in European notation (DD.MM.YYYY)\n- date_to - end date in European notation (DD.MM.YYYY)\n- transaction_type - optional: \"booked\" (default if not specified) or \"pending\" (\"vorgemerkt\")\n\nthis method returns a list of transactions.\n\nA list of transactions for a regular checking account follows the below format.\n\n```python\nfrom pprint import pprint\npprint(tlist)\n[{'amount': -44.98,\n  'bdate': '2023-01-22',\n  'currencycode': 'EUR',\n  'customerreferenz': 'XXXXXX',\n  'peer': 'PayPal Europe S.a.r.l. et Cie S.C.A',\n  'peeraccount': 'XXXXXXXXX',\n  'peerbic': 'XXXXXXXXX',\n  'peerid': 'XXXXXXXXXXX',\n  'postingtext': 'FOLGELASTSCHRIFT',\n  'reasonforpayment': 'XXXXXX PP.XXXXX.PP . Foo-bar AG, Ihr Einkauf bei '\n                      'Foo-bar AG',\n  'vdate': '2023-01-22'},\n {'amount': -70.05,\n  'bdate': '2023-01-22',\n  'currencycode': 'EUR',\n  'customerreferenz': '68251782022947180823144926',\n  'peer': 'FEFASE GmbH',\n  'peeraccount': 'XXXXXXXXX',\n  'peerbic': 'XXXXXXXXX',\n  'peerid': 'XXXXXXXXX',\n  'postingtext': 'SEPA-ELV-LASTSCHRIFT',\n  'reasonforpayment': 'ELV68251782 18.08 14.49 MEFAS ',\n  'vdate': '2023-01-22'},\n {'amount': -7.49,\n  'bdate': '2023-01-22',\n  'currencycode': 'EUR',\n  'customerreferenz': '3REFeSERENC',\n  'peer': 'PEER',\n  'peeraccount': 'XXXXXXXXX',\n  'peerbic': 'XXXXXXXXX',\n  'peerid': 'XXXXXXXXX',\n  'postingtext': 'FOLGELASTSCHRIFT',\n  'reasonforpayment': 'VIELEN DANK VON BAR-FOO GMBH',\n  'vdate': '2023-01-22'}]\n```\n\nThe list of transactions from a creditcard will look as below:\n\n```python\n[{'amount': 500.0,\n  'bdate': '2023-08-18',\n  'currencycode': 'EUR',\n  'text': 'Berliner Sparkasse',\n  'vdate': '2023-08-18'},\n {'amount': 125.95,\n  'bdate': '2023-08-14',\n  'currencycode': 'EUR',\n  'text': 'Zara Deutschland 3742',\n  'vdate': '2023-08-14'},\n {'amount': 500.0,\n  'bdate': '2023-08-14',\n  'currencycode': 'EUR',\n  'text': 'Commerzbank Berlin',\n  'vdate': '2023-08-14'}]\n```\n\nA brokerage account (depot) will not show the list of transactions but rather a list of positions:\n\n```python\n[{'currencycode': 'EUR',\n  'isin_wkn': 'DE0005140008',\n  'lastorderdate': '2017-01-01',\n  'market': 'Frankfurt',\n  'price': 9.872,\n  'price_euro': '39488.00',\n  'quantity': 4000.0,\n  'shares_unit': 'pieces',\n  'text': 'DEUTSCHE BANK AG NA O.N.'},\n {'currencycode': 'EUR',\n  'isin_wkn': 'DE0005557508',\n  'lastorderdate': '2017-10-01',\n  'market': 'Frankfurt',\n  'price': 19.108,\n  'price_euro': '28.662.00',\n  'quantity': 1500.0,\n  'shares_unit': 'pieces',\n  'text': 'DT.TELEKOM AG NA'}]\n```\n\nto get the credit limits per account or credit-card the method get_credit_limits() must be used\n\n```python\n\u003e c_list = dkb.get_credit_limits()\n```\n\nThis method returns a dictionary of all identified accounts including the credit limit per account\n\n```python\n{u'XXXX********XXXX': 100.00,\n u'4748********XXXX': 10000.00,\n u'XXXX********XXXX': 10000.00,\n u'DEXX XXXX XXXX XXXX XXXX XX': 200.00,\n u'DEXX XXXX XXXX XXXX XXXX XX': 2000.00}\n```\n\nA list of standing orders (Daueraufträge) can be obtained by calling get_standing_orders() method\n\n```python\n\u003e so = dkb.get_standing_orders(account_id)\n```\n\n- account_id - 'id' field from account dictionary (`dkb.account_dic[x]['id']`)\n\nA list of standing orders will be returned containing a dictionary per standing order\n\n```python\n\u003e pprint(so)\n[{'amount': 30.0,\n  'creditoraccount': {'bic': 'BIC-1', 'iban': 'IBAN-1'},\n  'currencycode': 'EUR',\n  'interval': {'frequency': 'monthly',\n               'from': '2019-01-05',\n               'holidayExecutionStrategy': 'following',\n               'nextExecutionAt': '2023-10-01',\n               'until': '2025-12-01'},\n  'purpose': 'Purpose-1',\n  'recpipient': 'Recipient-1'},\n {'amount': 58.0,\n  'creditoraccount': {'bic': 'BIC-2', 'iban': 'IBAN-2'},\n  'currencycode': 'EUR',\n  'interval': {'frequency': 'monthly',\n               'from': '2022-12-30',\n               'holidayExecutionStrategy': 'following',\n               'nextExecutionAt': '2023-12-01'},\n  'purpose': 'Purpose-2',\n  'recpipient': 'Recipient-2'},]\n```\n\nThe method get_exemption_order() can be used to get the exemption orders (Freistellungsaufträge)\n\n```python\n\u003e exo = dkb.get_exemption_order()\n```\n\nA dictionary similar to the one below will be returned\n\n```python\n\u003e pprint(exo)\n[{'amount': 2000.0,\n  'currencycode': 'EUR',\n  'partner': {'dateofbirth': '1980-01-01',\n              'firstname': 'Jane',\n              'lastname': 'Doe',\n              'salutation': 'Frau',\n              'taxid': '1234567890'},\n  'receivedat': '2017-01-01',\n  'type': 'joint',\n  'used': 567.89,\n  'validfrom': '2020-01-01',\n  'validto': '9999-12-31'}]\n```\n\nTo get the amount of dkb points the below method can be used\n\n```python\n\u003e points_dic = dkb.get_points()\n```\n\nA dictionary similar to the below will be returned\n\n```python\n\u003e pprint(points_dic)\n{u'DKB-Punkte': 99999,\n u'davon verfallen zum  31.12.2018': 999}\n```\n\nTo scan the DKB postbox for documents  the below method can be used\n\n```python\n\u003e document_dic = dkb.scan_postbox(path, download_all, archive, prepend_date)\n```\n\n- path - optional argument. If specified, documents will be downloaded and stored\n- dowload_all (True/**False**) - optional argument. By default only unread documents from DKB postbox will get downloaded and marked as \"read\". By setting this parameter all documents will be downloaded\n- archive (True/**False**) - optional argument. When set to `True` the \"Archiv\" folder in the Postbox will be scanned and documents will be downloaded if a `path` variable is specificed. *Handle this parameter with care as the amount of documents to be downloaded can be huge*.\n- prepend_date (True/**False**) - optional argument. Prepend document date in `YYYY-MM-DD_` format to each document to allow easy sorting of downloaded files\n\nThe method will return a dictionary containing the different postbox folders and links to download the corresponding documents\n\nCheck the scripts [dkb_example.py](doc/dkb_example.py) and [dkb_docdownload.py](doc/dkb_docdownload.py) for further examples.\n\n## dkb_robo command line interface (CLI)\n\nStarting with v0.20 dkb_robo comes with a CLI tool\n\n```bash\n$ dkb --help\nUsage: dkb [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -d, --debug                     Show additional debugging\n  -t, --chip-tan TEXT             use [ChipTan](https://www.dkb.de/fragen-antworten/was-ist-das-chiptan-verfahren) for login (\"qr\" for chipTan-QR \"manual\" for chipTan-manuell)\n  -u, --username TEXT             username to access the dkb portal\n                                  [required]\n  -p, --password TEXT             corresponding login password\n  --format [pprint|table|csv|json]\n                                  output format to use\n  --help                          Show this message and exit.\n\nCommands:\n  accounts\n  credit-limits\n  last-login\n  standing-orders\n  transactions\n```\n\n### Example command to fetch account list\n\n```bash\npy dkb -u \u003cuser\u003e -p \u003cpassword\u003e accounts\n```\n\n### Example commands to fetch transactions via CLI tool\n\n```bash\npy dkb -u \u003cuser\u003e -p \u003cpassword\u003e transactions --name Girokonto\npy dkb -u \u003cuser\u003e -p \u003cpassword\u003e transactions --account \"DE75xxxxxxxxxxxxxxxxxxx\"\npy dkb -u \u003cuser\u003e -p \u003cpassword\u003e transactions --account \"DE75xxxxxxxxxxxxxxxxxxx\" --date-from 2023-08-01  --date-to 2023-08-15\"\n```\n\n## Further documentation\n\nplease check the [doc](https://github.com/grindsa/dkb-robo/tree/master/doc) folder of the project. You will find further documentation and an example scripts of all dkb-robo methods there.\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://github.com/grindsa/dkb-robo/blob/master/CONTRIBUTING.md) for details on my code of conduct, and the process for submitting pull requests.\nPlease note that I have a life besides programming. Thus, expect a delay in answering.\n\n## Versioning\n\nI use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/grindsa/dkb-robo/tags).\n\n## License\n\nThis project is licensed under the GPLv3 - see the [LICENSE.md](https://github.com/grindsa/dkb-robo/blob/master/LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrindsa%2Fdkb-robo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrindsa%2Fdkb-robo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrindsa%2Fdkb-robo/lists"}