This is my fork of the pytr library for the private API of the Trade Republic online brokerage. I have stripped down the functionality to use only the transaction field download.
$ pytr help
usage: pytr [-h] [-v {warning,info,debug}] [-V]
{help,login,dl_docs,export_transactions}
...
Use "pytr command_name --help" to get detailed help to a specific command
Commands:
{help,login,dl_docs,export_transactions}
Desired action to perform
help Print this help message
login Check if credentials file exists. If not create it
and ask for input. Try to login. Ask for device reset
if needed
dl_docs Download all pdf documents from the timeline and sort
them into folders. Also export account transactions
(account_transactions.csv) and JSON files with all
events (events_with_documents.json and
other_events.json
export_transactions Create a CSV with the deposits and removals ready for
importing into Portfolio Performance
Options:
-h, --help show this help message and exit
-v {warning,info,debug}, --verbosity {warning,info,debug}
Set verbosity level (default: info)
-V, --version Print version information and quit
There are two authentication methods:
- Web login (default)
- App login
Web login is the newer method that uses the same login method as app.traderepublic.com, meaning you receive a token in the TradeRepublic app or via SMS.
App login is the older method that uses the same login method as the TradeRepublic app. First you need to perform a device reset - a private key will be generated that pins your "device". The private key is saved to your keyfile. This procedure will log you out from your mobile device.
$ pytr login
$ # or
$ pytr login --phone_no +49123456789 --pin 1234
If no arguments are supplied pytr will look for them in the file ~/.pytr/credentials
(the first line must contain the phone number, the second line the pin). If the file doesn't exist pytr will ask for for the phone number and pin.