Skip to main content

Use TradeRepublic in terminal

Project description

GitHub tag (with filter) PyPI build and publish PyPI - Version

pytr: Use TradeRepublic in terminal

This is a library for the private API of the Trade Republic online brokerage. I am not affiliated with Trade Republic Bank GmbH.

Installation

Make sure Python and a Python package manager like pip or pipx (recommended) is installed.

Install release from PyPI with:

pipx install pytr

Or install from git repo like so:

pipx install git+https://github.com/pytr-org/pytr.git

Update

pipx upgrade pytr
# or
pipx upgrade-all

Usage

$ pytr help
usage: pytr [-h] [-v {warning,info,debug}] [-V]
            {help,login,dl_docs,portfolio,details,get_price_alarms,set_price_alarms,export_transactions,completion}
            ...

Use "pytr command_name --help" to get detailed help to a specific command

Commands:
  {help,login,dl_docs,portfolio,details,get_price_alarms,set_price_alarms,export_transactions,completion}
                         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). A folder path must be provided
                         as second argument.
    portfolio            Show current portfolio
    details              Get details for an ISIN
    get_price_alarms     Get overview of current price alarms
    set_price_alarms     Set price alarms based on diff from current price
    export_transactions  Create a CSV with the deposits and removals ready for
                         importing into Portfolio Performance
    completion           Print shell tab completion

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

Authentication

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytr-0.3.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

pytr-0.3.0-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file pytr-0.3.0.tar.gz.

File metadata

  • Download URL: pytr-0.3.0.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.7

File hashes

Hashes for pytr-0.3.0.tar.gz
Algorithm Hash digest
SHA256 387edfaca5c7f2675e13a154d84df772ca22b78dfff4ba01d5ce4a9f7e27e6cb
MD5 5edf94691b93d7e1b65851f4f665a84b
BLAKE2b-256 482a1879cc8e25a17891cbb8dae442bd272c4c2890de7a86c7d76052a94876a8

See more details on using hashes here.

File details

Details for the file pytr-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pytr-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.7

File hashes

Hashes for pytr-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 007e6da4000568f8a1b0a919ed9b6c45cabfd417dbad8f27f44dec4edf9cb8a6
MD5 bc307bee19a905946f41e6027a059e7d
BLAKE2b-256 33778b66a5b0306293f3772fa5c357d34631ee20f4e7d41bc0f55e3c3e56c3b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page