-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way I can download the Account Statement as .csv? #38
Comments
With the enhancement contributed in #16 you can make your own: import csv
from datetime import date
degiro = ... # connect & login here
ao = degiro.account_overview(date(2021, 4, 1), date.today())
cash_movements = ao["cashMovements"] # type: List[Dict]
fieldnames = ['date', 'valueDate', 'description', 'currency', 'change', 'type', 'exchangeRate', 'orderId']
# productId, balance: also available but they would require further processing
with open('report.csv', 'w', newline='', encoding='utf-8') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fieldnames, extrasaction="ignore")
writer.writeheader()
writer.writerows(cash_movements) |
Hummmm, I see, thanks @Jakub-CZ . Date, Time, Value date, Product, ISIN, Description, FX, Change_Currency, Change_Value, Balance_Currency, Balance_Value, and Order Id Is the ISIN represented by any of the fields from |
In my report The field This is how you can build a handy-dandy dictionary mapping all the productIds that appear in from pprint import pprint
from degiroapi.product import Product
pid_map = {p: Product(degiro.product_info(p)).isin for p in filter(None, {e.get("productId") for e in cash_movements})}
pprint(pid_map)
# {322171: 'US4581401001',
# 331916: 'US94106L1098',
# 332062: 'US7170811035',
# ... How to put this all together in a single CSV is left as an exercise to the reader. |
No description provided.
The text was updated successfully, but these errors were encountered: