All Projects → bramton → degiro

bramton / degiro

Licence: BSD-3-Clause license
Very basic unofficial Python API for DeGiro

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to degiro

degiro-trading-tracker
Simplified tracking of your investments
Stars: ✭ 16 (-68%)
Mutual labels:  degiro
DGPC
DGPC: DeGiro Performance Charts
Stars: ✭ 13 (-74%)
Mutual labels:  degiro

Unofficial DeGIRO Python API

Very basic unofficial Python API for DeGiro. This API is only able to get details about your portfolio. It cannot be used for automatic trading. For a way more extensive Node.js API have a look at pladarias work.

⚠️ DeGiro could change their API at any moment, if something is not working, please open an issue.

Security

Your password is stored plain text in a JSON file. Take adequate measures !, e.g. chmod it to 600. The API also won't work for users who have 2FA enabled.

Example usage

from degiro import degiro

la = degiro()
la.login('config.json')
la.getConfig()
pfs = la.getPortfolioSummary()
portfolio = la.getPortfolio()
total = pfs['equity']

# Prints a pretty table of your equities and their allocation.
print('{:<20}\tsize\tvalue\tsubtot\t\talloc'.format('Product'))
for row in portfolio['PRODUCT'].values():
    subtot = row['size']*row['price']
    alloc = (subtot/total)*100 # Asset allocation (%)
    print('{:<20}\t{:5.1f}\t{:6.2f}\t{:7.2f}\t\t{:2.1f}%'.format(row['name'], row['size'], row['price'], subtot, alloc))
print('Total: {:.2f}'.format(total))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].