A package for read operations for the comdirect API
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file comdirect-api-simple-0.0.15.tar.gz
.
File metadata
- Download URL: comdirect-api-simple-0.0.15.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e000f088b9698d489701178c635ae9579e41c7fbb15a3d666b2f0a08e610759a |
|
MD5 | 1e6b405499e2919789f2cd885119ac87 |
|
BLAKE2b-256 | a0382735444af860851e42f8f6eda1c61107de4708ea3d69fd0bfa059abe518a |
File details
Details for the file comdirect_api_simple-0.0.15-py3-none-any.whl
.
File metadata
- Download URL: comdirect_api_simple-0.0.15-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ad5ecc245ca2d6792d1e69955988ce89ff33495aae94d87e74a8a1c50e87085 |
|
MD5 | 654d35dcbc808a3c256543649defd387 |
|
BLAKE2b-256 | f1cdc71a831dd96a0a5b3f370d4a3d36a2fe2fef3554add6a9082bbae4bd7fdb |