
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Yahoo Finance Portfolio Visualizer - A Python tool for downloading and visualizing stock portfolio transactions using Yahoo Finance data
Yahoo Finance Portfolio Visualizer - A Python tool for downloading and visualizing stock portfolio transactions using Yahoo Finance data.
pip install yfinance-viz
After installation, you can use the convenient CLI commands:
# Parse transactions from your portfolio data directory
yfinance-viz-parse --resources-path /path/to/my/portfolio/data
# Download stock history to your portfolio data directory
yfinance-viz-download --resources-path /path/to/my/portfolio/data
# Generate visualization from your portfolio data directory
yfinance-viz-visualize --resources-path /path/to/my/portfolio/data
Determine your portafolio ID by going to and looking for the p_0 or similar in the path when opening the portafolio in:
https://finance.yahoo.com/portfolios/
Download your portfolio transactions from Yahoo Finance:
https://query1.finance.yahoo.com/ws/portfolio-api/v1/portfolio/transactions?pfId=YOUR_PORTFOLIO_ID&category=trades&groupByPositionId=true&lang=en-US®ion=US
Save the JSON file in your chosen resources directory (e.g., my_portfolio_data/my_portfolio.json
).
yfinance-viz-parse --resources-path /path/to/my/portfolio/data
This will:
transactions.csv
in your resources directoryyfinance-viz-download --resources-path /path/to/my/portfolio/data
Downloads historical price data for all tickers in your transactions.
yfinance-viz-visualize --resources-path /path/to/my/portfolio/data
Creates an interactive Sankey diagram showing fund flows between your portfolio positions.
yfinance-viz/
├── yfinance_viz/ # Main module
│ ├── __init__.py
│ ├── transaction_parser.py
│ ├── download_stock_history.py
│ └── transactions_visualize.py
├── tests/ # Comprehensive test suite
├── pyproject.toml # Project configuration
└── README.md
All scripts require the following argument:
--resources-path
: Path to the directory containing your portfolio data
--resources-path /Users/john/my_portfolio_data
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=yfinance_viz
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Yahoo Finance Portfolio Visualizer - A Python tool for downloading and visualizing stock portfolio transactions using Yahoo Finance data
We found that yfinance-viz demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.