Generate stock dataset

This python notebook generates the stock dataset. This requires data from the Financial Modelling Prep resource which requires an account, which under circumstances can be free of charge.

once you have a key, you may either store it on the fmp_key file, or simply assign it as a string value to the fmp_api_key variable.

The resulting dataset is stored in the sqlite3 format at the path pointed to by the file_output variable. The dataset consists of financial information for the companies, stocks of which are listed in the New York Stack Exchange. With these, we also store daily price time-series since the beginning of 2019.

All downloaded data are cached in the output file (and only the erroneous/pending entries are retried each time).

FMP Data parser

This class parses the online data from the FMP resource.

Parse Stock names

This selects the stocks listed in the New York Stack Exchange (NYSE).

Parse company Profiles

Fetch and store the company profile entries for each stock in the df_stocks table.

Parse price time series

Fetch and store the daily prices for each stock since the beginning of 2019.

Parse executive information

Fetch and store general information about the most important executive people of each company, for which the stock is listed.