Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pytr

> 数据库
Open source

Use TradeRepublic in terminal and mass download all documents

775 stars0 likes1 views
WebsiteGitHub

About

Use TradeRepublic in terminal and mass download all documents

pytr: Use TradeRepublic in terminal

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

Table of Contents

  • Quickstart
  • Usage
  • Authentication
    • Web login
  • Development
    • Setting Up a Development Environment
    • Linting and Code Formatting
    • Release process
    • Keep the readme updated
  • License

Quickstart

This is the right section for you if all you want to do is to "just run the thing". Whether you've never run a piece of code before, or are new to Python, these steps will make it the easiest for you to run pytr.

We strongly recommend that you use uv to run pytr. Since pytr is written in the Python programming language, you usually need to make sure you have an installation of Python on your computer before you can run any Python program. However, uv will take care of installing an appropriate Python version for you if you don't already have one.

To install uv on OSX/Linux, run:

bash
 curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows, run:

bash
 powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Then, to run the latest released version of pytr:

bash
 uvx pytr@latest

If you want to use the cutting-edge version, use this command instead:

bash
 uvx --with git+https://github.com/pytr-org/pytr.git pytr

Usage

…

Authentication

Web login

Web login uses the public web-login endpoints at api.traderepublic.com. Two variants are available:

  • v1 (default): pytr login. You receive a four-digit code in the TradeRepublic app (or via SMS as a fallback) and enter it in the terminal. This is the original behavior; nothing changes for existing users. v1 requires passing an AWS WAF token with the login request; by default pytr fetches one automatically via Playwright (requires the optional playwright extra: pip install 'pytr[playwright]' && playwright install chromium). The pure-Python alternative --waf-token awswaf exists but has been reported to no longer work reliably.
  • v2 (opt-in): pytr login --v2. Mirrors what app.traderepublic.com currently does. Instead of typing a four-digit code, you confirm the login from a push notification in the Trade Republic mobile app. Accounts secured with an authenticator app are asked for a code from that app instead. Useful if your account no longer issues a code via the app or SMS. v2 does not require a WAF token; pytr skips it automatically when --v2 is used. Note that Trade Republic removed the SMS resend endpoint along with the v1 web login, so there is no SMS fallback under --v2. The flag is available on every subcommand that performs a login, e.g. pytr portfolio --v2, pytr dl_docs --v2.

Both variants keep you logged in on your primary device, but you may need to re-authenticate every so often when running pytr.

Development

Setting Up a Development Environment

Clone the repository:

bash
 git clone https://github.com/pytr-org/pytr.git

Install dependencies:

bash
 uv sync

Run the tests to ensure everything is set up correctly:

bash
 uv run pytest

Linting and Code Formatting

This project uses Ruff for code linting and auto-formatting, as well as Mypy for type checking.

You can auto-format the code with Ruff by running:

bash
uv run ruff format            # Format code
uv run ruff check --fix-only  # Remove unneeded imports, order imports, etc.

You can check the typing of the code with Mypy by running:

bash
uv run mypy .

Ruff and Mypy run as part of CI and your Pull Request cannot be merged unless it satisfies the linting, formatting checks and type checks.

Release process

  1. Create a pull request that bumps the version number in pyproject.toml
  2. After successfully merging the PR, create a new release via GitHub and make use of the "Generate release notes" button. Tags are formatted as vX.Y.Z.
  3. The package will be published to PyPI from CI.

Keep the readme updated

This readme contains a few automatically generated bits. To keep them up to date, simply run the following command: (Never start it from an activated venv!)

bash
 uvx [email protected] -i README.md

License

This project is licensed under the MIT License. See the LICENSE file for details.

Issues· 33 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonfinancepdf-extractionportfolioportfolio-performance

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库