Skip to content

[ENH] Remove yfinance as a dependency and implement data_loader#721

Open
Shuvam586 wants to merge 1 commit intoPyPortfolio:mainfrom
Shuvam586:remove-yfinance
Open

[ENH] Remove yfinance as a dependency and implement data_loader#721
Shuvam586 wants to merge 1 commit intoPyPortfolio:mainfrom
Shuvam586:remove-yfinance

Conversation

@Shuvam586
Copy link

Closes #716

  • Replaces yfinance usage in notebooks with bundled static example data (stock_prices.csv and market_caps.csv).
  • Adds pypfopt.data loaders for stock prices and market caps.
  • Removes yfinance dependency entirely.

@Shuvam586
Copy link
Author

@fkiraly

instead of editing tickers mentioned in the cookbook notebooks, i added 2 csv files to pypfopt/data. stock_prices.csv and market_caps.csv with only data from 2023 onwards. the stock_prices.csv is around 450kb.

also removed yfinance related statements and functions from all notebooks

@fkiraly fkiraly changed the title [ENH] Remove yfinance as a dependancy and implement data_loader [ENH] Remove yfinance as a dependency and implement data_loader Mar 3, 2026
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

May I request to not use data downloaded via yfinance from Yahoo services at all? This is due to terms of use, we should not distribute data from Yahoo services at all in the repository or package.

Could you instead use similar data? Either completely randomly generated (Brownian motion random walk or similar, with same column names and time index), or taking some inspiration from the actual data in how you randomize - but it cannot be the exact values.

@fkiraly fkiraly added the documentation Documentation & tutorials label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation & tutorials

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] Remove yfinance from notebooks and examples

2 participants