Investment Analysis — Dataset
In this article, we will use open-source libraries to create the dataset for investment analysis purposes.
This article is part of the Investment Analysis series.
The source code is available in this repository.
Previously we talked about open source investment research using the OpenBB Terminal. For every market, there could be thousands of stocks to research. Without any automation, it becomes challenging to short-list promising stocks worth spending our time researching.
In an earlier article, we use Python to gather stock data and perform fundamental analysis. Leveraging the same idea, let’s create a better dataset for analysis purposes.
Python Libraries — investpy and yfinance
investpy library, we can get a list of stocks for a particular market. With the information, we can get the stock details, financial information, dividend history, cash flow, earning dates, news, recommendations, and other information from the respective sources using
We will get started by developing the code to download stock information (e.g. EPS, PEG, yield, etc), stock financials, and the last 10 years' dividend history.
Downloader is a class decorator we use to manage the downloading. It can resume the download from the point it gets stopped previously.
The downloaded information is saved into an Excel file to make it easy for analysis purposes.
Downloader, we can download any information we need easily.