chapter three

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

In Chapter 2, we 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 data in finance is cleaner than data from other domains. Still, even with superb data, we need to invest time to prepare data for analytical algorithms and decide how we want to extract insights most efficiently.

In this chapter, we will show how to work with data from free and freemium sources. Some open-source libraries scrape data from platforms with a web UI that presents financial data to users, such as Google Finance, Yahoo Finance, and Finviz. As we will show in this chapter, this approach satisfies primary use cases but also has limitations. Professional finance data providers supply clients with financial data from different markets through APIs on a paid subscription basis.

3.1 Financial Data

3.2 Financial 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