A command-line tool to synchronize Trade Republic transactions with You Need A Budget (YNAB).
TR2YNAB is a Python-based utility that automatically fetches your transaction history from Trade Republic and imports it into your YNAB budget. It keeps track of the last import date to avoid duplicate transactions and handles various transaction types including card payments, trades, and fees.
- Automatic authentication with Trade Republic
- Smart transaction synchronization using last import date
- Configurable import settings
- Support for all Trade Republic transaction types
- Automatic conversion to YNAB transaction format
- Command-line interface for easy automation
Install TR2YNAB using pip:
pip install tr2ynab
- Create a configuration file at
~/.config/tr2ynab/tr2ynab.cfg
with your credentials:
[TradeRepublic]
phone_no = "+491234567890"
pin = "123456"
[YNAB]
access_token = "your_ynab_access_token"
budget_id = "your_ynab_budget_id"
account_id = "your_ynab_account_id"
- Run the synchronization:
tr2ynab --config ~/.config/tr2ynab/tr2ynab.cfg
--config
: Path to the configuration file (default:~/.config/tr2ynab/tr2ynab.cfg
)--version
: Show program version and exit
phone_no
: Your Trade Republic phone number (with country code)pin
: Your Trade Republic PIN
access_token
: Your YNAB API access tokenbudget_id
: The ID of your YNAB budgetaccount_id
: The ID of your YNAB account where transactions should be imported
To set up the development environment:
# Clone the repository
git clone https://github.com/yourusername/tr2ynab.git
cd tr2ynab
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -e .
Frédéric Gierlinger frederic.gierlinger@gmail.com
This project is licensed under the MIT License - see the LICENSE file for details.