Calculate the earnings per share (EPS), a valuation ratio that measures the amount of net income earned per share of outstanding common stock.

The earnings per share (EPS) is a widely used financial metric that helps investors understand the profitability of a company on a per-share basis. It provides insight into the portion of a company’s earnings that is allocated to each outstanding share of its common stock. EPS is an important measure for investors and analysts when assessing a company’s financial performance and comparing it to other companies.

The formula is as follows:

\[\text{Earnings per Share} (\text{EPS}) = (\text{Net Income} - | \text{Preferred Dividends Paid} |) / \text{Weighted Average Shares}\]

Also known as: EPS, net income per share.

Earnings per Share (EPS) in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_earnings_per_share as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL", "TSLA"], api_key="FINANCIAL_MODELING_PREP_KEY")

eps_ratios = toolkit.ratios.get_earnings_per_share()

Which returns:

  2021 2022 2023 2024 2025
AAPL 5.614 6.1132 6.1341 6.0836 7.465
TSLA 1.6341 3.6213 4.3067 2.0383 1.0754

Parameters

The function accepts the following parameters:

  • include_dividends (bool, optional): Whether to include dividends in the EPS calculation. Defaults to False.
  • diluted (bool, optional): Whether to use diluted earnings per share. Defaults to True.
  • rounding (int, optional): The number of decimals to round the results to. Defaults to 4.
  • growth (bool, optional): Whether to calculate the growth of the ratios. Defaults to False.
  • lag (int | str, optional): The lag to use for the growth calculation. Defaults to 1.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
  • trailing (int): Defines whether to select a trailing period. E.g. when selecting 4 with quarterly data, the TTM is calculated.
Share