Introduction

Stock market analysis and good investing (for long-term growth) require careful examination of the financial data. Various metrics and ratios are often used in such analysis i.e. to assess the inherent quality of a stock. You may have heard about some of them in the talk from financial and investment experts.

For example, the Price-over-Earning ratio or PE ratio. It is the ratio of the share price over the annual earnings/share.

Or, the Book value per share. It takes the ratio of a firm’s common equity divided by its number of shares outstanding. When a stock is undervalued, it will have a higher book value per share in relation to its current stock price in the market.

Assessing a Stock’s Future With the Price-to-Earnings Ratio and PEG

The price-to-earnings ratio (P/E) is one of the most widely used metrics for investors and analysts to determine stock…

Often such data are available from websites like Yahoo Finance. However, unless, you are using some kind of paid, registered service, you cannot download or scrape the data programmatically.

Yahoo Finance - Stock Market Live, Quotes, Business & Finance News

At Yahoo Finance, you get free stock quotes, up-to-date news, portfolio management resources, international market…

However, many microservices exist which provide such data over a simple API call. To take advantage of that, we show, in this article,** how to write a simple Python class script for interfacing with a financial data microservice.**

Figure

Image source: Screen capture by the author (Website)

With this Python class, you can pull data and build a Pandas DataFrame with almost all important financial metrics and ratios by invoking a series of simple methods.

We also provide simple charting methods (bar chart and scatter plots) for analyzing the data graphically.

Note, that, you need to obtain your own secret API key (free) from the website and register it after instantiating the class object.

With that being said, let us examine the Python package/class and the various methods that come with it.

#2020 jul tutorials #overviews #finance #pandas #python #programming

Pull and Analyze Financial Data Using a Simple Python Package
3.20 GEEK