ETF-it is an (alpha) tool designed to provide investors with a deeper understanding of the companies that comprise their ETF investments. This information is sometimes not easily accessible.
The tool aims to offer transparency into the exact companies included in ETF holdings, so that retail investors can make better informed decisions about where their investment capital should be allocated.
- Scrapes ETF holdings data from Vanguard's website
- Aggregates holdings across multiple ETFs
- Provides a breakdown of the top holdings by value
- Calculates the total portfolio value of each holding
-
Clone this repository:
git clone https://github.com/matthelmer/etf-it.git cd etf-it -
Set up a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` -
Install the required Python packages:
pip install -r requirements.txt -
Ensure you have Chrome browser installed and the appropriate ChromeDriver for your Chrome version in your system PATH.
-
Create a JSON file (e.g.,
my_positions.json) with your ETF holdings:{ "VOO": {"shares": 10, "price": 400.50}, "VTI": {"shares": 15.1, "price": 220.75} } -
Run the script:
python decomposer.py --positions my_positions.jsonIf no positions file is specified, it will use
example-positions.jsonby default. -
The script will use existing CSV files for ETFs if available, or scrape new data if needed.
- Results are saved in
aggregated_holdings.csv - Summary statistics, including total portfolio value and top 10 holdings, are printed to the console.
- If you encounter WebDriver issues, ensure your ChromeDriver version matches your Chrome browser version.
- For scraping failures, check your internet connection and try again. The tool includes retry logic for common issues.
The tool uses Python's logging module. You can adjust the logging level in the script if you need more detailed output for troubleshooting.
This tool is provided for informational purposes only. It is not intended to be used as financial or investment advice. The data provided by this tool may not be complete, accurate, or up-to-date. Use this tool at your own risk. The creators and contributors of this tool are not responsible for any financial losses or other damages that may result from its use.
This project is licensed under the MIT License - see the LICENSE file for details.