Calculate the price to sales ratio (P/S), a valuation ratio that compares a company’s market capitalization to its total revenue.

The price to sales ratio is particularly useful for valuing companies that are not yet profitable (and therefore have no meaningful P/E ratio), since revenue is typically positive even when earnings are not, and is less susceptible to accounting distortions than earnings-based multiples. It is, however, less informative than earnings- or cash-flow-based multiples for mature, profitable companies since it ignores profitability and cost structure entirely.

The formula is as follows:

\[\text{Price to Sales Ratio} = \text{Market Cap} / \text{Revenue}\]

Also known as: P/S ratio, sales multiple.

Price to Sales Ratio (PS) in Python

get_price_to_sales_ratio is part of the Ratios module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_price_to_sales_ratio as shown below.

from financetoolkit import Toolkit

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

price_to_sales_ratio = toolkit.ratios.get_price_to_sales_ratio()

Parameters

get_price_to_sales_ratio accepts the following parameters:

  • show_daily (bool, optional): Whether to show daily data. Defaults to False.
  • diluted (bool, optional): Whether to use diluted shares in the calculation. 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