Small personal tool to load stock transactions from an Excel file, compute realized returns + IRR, optionally fetch current prices from Yahoo Finance, and view everything in a Streamlit dashboard.
- Python 3
transactions.xlsx(see format below)- (Optional, for
--download)ticker_symbols.xlsx(see format below) - Environment variable
INVESTMENTS_DATA_DIRpointing to the folder containing those spreadsheets
Required columns:
date: date (yyyy-mm-dd; used as index)company: company name (string)shares: positive for buys, negative for sells, empty for dividend rowsvalue: negative for buys (cash out), positive for sells (cash in), empty for dividend rowsdividend: cash received (positive), empty for non-dividend rows
Required columns (no header):
name: must match thecompanynames used intransactions.xlsxticker: Yahoo Finance symbol (e.g.AAPL,IBE.MC)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtSet the data path (example):
export INVESTMENTS_DATA_DIR="/path/to/data"python investments.py
python investments.py --downloadstreamlit run app.pypytest -q