Calculate the operating cash flow ratio, a liquidity ratio that measures a company’s ability to pay off its current liabilities with its operating cash flow.

The operating cash flow ratio is calculated by dividing operating cash flow by current liabilities. It indicates whether a company’s operating cash flow is sufficient to cover its short-term obligations.

The formula is as follows:

\[\text{Operating Cash Flow Ratio} = \text{Cash Flow from Operations} / \text{Current Liabilities}\]

Also known as: OCF ratio, cash liquidity.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Operating Cash Flow Ratio for you. Just ask in plain English.

Calculate the Operating Cash Flow Ratio in Python

The Operating Cash Flow Ratio is available in the Ratios module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_operating_cash_flow_ratio as shown below.

from financetoolkit import Toolkit

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

operating_cash_flow_ratios = toolkit.ratios.get_operating_cash_flow_ratio()

Which returns:

  2021 2022 2023 2024 2025
AAPL 0.8291 0.7933 0.7607 0.6704 0.6731
TSLA 0.5835 0.5513 0.4611 0.5178 0.465

Parameters

get_operating_cash_flow_ratio accepts the following parameters:

  • 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.

The Ratios module page introduces the module, and the sidebar lists all of its functions.

Share