Skip to main content

Comdirect API

This is an unofficial python wrapper for the comdirect API for private consumers (April 2020).

This package currently only supports read operations, which include:

  • Read balances and transactions
  • Read depot information
  • Read and download Documents
  • Read and update orders
  • Read instrument information
  • Export and import the session

Install

Install the package using pip

pip install comdirect-api-simple

Usage

Initialize the client:

from comdirect_api.comdirect_client import ComdirectClient

client_id = '<your_client_id>'
client_secret = '<your_client_secret>'
client = ComdirectClient(client_id, client_secret)

Login with your credentials like so:

user = 'your_zugangsnummer'
password = 'your_pin'
client.fetch_tan(user, password)

After confirming the login on your photoTAN app you can activate your session.

client.activate_session()

You can refresh your token with:

client.refresh_token()

The the client is now ready for use, for example:

balances = client.get_all_balances()
print(balances['values'])

It is also possible to send a GET request to a self defined endpoint, for example:

client.get('reports/participants/user/v1/allbalances', productType='ACCOUNT')

List all the complete order-book and filter for OPEN orders:

data = client.get_all_orders(depotId, order_status='OPEN')
print(data)

You can change an OPEN order as follows:

orderId='XXYYYAA...'
order = client.get_order(orderId)
order['triggerLimit']['value'] = '16.6'
[challenge_id, challenge]=client.set_order_change_validation(orderId, order)
orderChanged=client.set_order_change(orderId,data, challenge_id)

To export the session you can use

client.activate_session()
...
client.session_export()

To import it in another instance call:

client = ComdirectClient('client_id', 'client_secret','session.pkl')

More information about the official API can be found at https://developer.comdirect.de

Release files for comdirect-api-simple 0.0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comdirect-api-simple 0.0.15
File Size Uploaded
comdirect-api-simple-0.0.15.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for comdirect-api-simple 0.0.15
File Interpreter ABI Platform
comdirect_api_simple-0.0.15-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 kB

Release files / comdirect-api-simple-0.0.15.tar.gz

Download URL comdirect-api-simple-0.0.15.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e000f088b9698d489701178c635ae9579e41c7fbb15a3d666b2f0a08e610759a
BLAKE2b-256 checksum
How to use checksums
a0382735444af860851e42f8f6eda1c61107de4708ea3d69fd0bfa059abe518a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.13

Release files / comdirect_api_simple-0.0.15-py3-none-any.whl

Download URL comdirect_api_simple-0.0.15-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ad5ecc245ca2d6792d1e69955988ce89ff33495aae94d87e74a8a1c50e87085
BLAKE2b-256 checksum
How to use checksums
f1cdc71a831dd96a0a5b3f370d4a3d36a2fe2fef3554add6a9082bbae4bd7fdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.13

Release history Release notifications | RSS feed

This release

0.0.15 This release

2 release files

0.0.14

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page