3 Collecting data

 

This chapter covers

  • Data collection from financial platforms
  • The types of data used for financial assessments
  • Selecting Python libraries for financial analysis
  • Comparing free Python libraries and commercial libraries
  • Fundamental and technical analysis using Python

Chapter 2 focused on what we can analyze to make sound investment decisions. With that knowledge, it is time to show how to collect and explore data. Some data analysts claim that financial data is cleaner than data from other domains. Still, even with superb data, we need to invest time in preparing it for analytical algorithms and determining how to extract insights most efficiently.

This chapter teaches you how to gather financial data using Python. We'll focus on yfinance, a powerful open-source library for scraping data from sources like Yahoo Finance, Google Finance, and Finviz.

While yfinance is excellent for our initial data exploration, we'll also discuss its limitations and explore more robust, production-ready alternatives. All the libraries we cover are either free or offer a freemium model.

We'll start by examining the unique characteristics of financial data. Then, you'll learn to use these Python libraries to collect it. With this knowledge, you'll be ready for the first use case in chapter 4.

3.1 Financial data

3.2 Financial analysis platforms

3.3 Data science notebooks

3.4 yfinance

3.4.1 Fundamental analysis

3.4.2 Technical analysis

3.4.3 Limitations of yfinance

3.5 Commercial libraries

3.5.1 Finviz

3.5.2 EODHD

3.5.3 Alpha Vantage

3.5.4 OpenBB

3.6 Other libraries

3.7 Summary