How to get stock earnings data with Python

How to get stock earnings data with Python

Python
In this post, we'll walk through a few examples for getting stock earnings data with Python. We will be using yahoo_fin, which was recently updated. The latest version now includes functionality to easily pull earnings calendar information for individual stocks or dates. If you need to install yahoo_fin, you can use pip: If you already have it installed and need to upgrade, you can update your version like this: To get started, let's import yahoo_fin: Getting stock earnings calendar data The first method we'll cover is the get_earnings_history function. get_earnings_history returns a list of dictionaries. Each dictionary contains an earnings date along with EPS actual / expected information. Let's test it out with a few sample tickers. Depending on the ticker, the data returned may include future earnings dates. Any…
Read More
Technical analysis with Python

Technical analysis with Python

Python
In this post, we will introduce how to do technical analysis with Python. Python has several libraries for performing technical analysis of investments. We're going to compare three libraries - ta, pandas_ta, and bta-lib. The ta library for technical analysis One of the nicest features of the ta package is that it allows you to add dozen of technical indicators all at once. To get started, install the ta library using pip: Next, let's import the packages we need. We'll be using yahoo_fin to pull in stock price data. Now, data contains the historical prices for AAPL. Next, let's use ta to add in a collection of technical features. Below, we just need to specify what fields correspond to the open, high, low, close, and volume. This single call automatically…
Read More