Operating Cycle
Calculate the operating cycle ratio, an efficiency ratio that measures the average number of days it takes a company to turn its inventory into cash.
The operating cycle represents the total time required to purchase inventory, convert it into finished goods, sell the goods to customers, and collect the accounts receivable. It is calculated by adding the days sales in inventory (DSI) and the days of sales outstanding (DSO).
The formula is as follows:
\[\text{Operating Cycle Ratio} = \text{Days of Sales in Inventory} + \text{Days of Sales Outstanding}\]Also known as: inventory-to-cash cycle.
Operating Cycle in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_operating_cycle as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["AMAT", "LRCX", "KLAC"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.ratios.get_operating_cycle()
Or, after setting up the Finance Toolkit MCP, ask:
How long was the operating cycle of Applied Materials, Lam Research and KLA, from buying inventory to collecting cash, from 2021 to 2025?
Which returns:
| 2021 | 2022 | 2023 | 2024 | 2025 | |
|---|---|---|---|---|---|
| AMAT | 187.185 | 213.516 | 227.837 | 212.291 | 209.118 |
| KLAC | 253.665 | 250.855 | 279.334 | 341.358 | 301.427 |
| LRCX | 171.022 | 207.597 | 240.81 | 275.374 | 222.92 |
Parameters
get_operating_cycle accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
days | int | float | The number of days in the window the flows cover. Defaults to None, which uses 365 for annual data and 365 / 4 for quarterly data, multiplied by trailing when set (e.g. 365 for quarterly data with trailing=4). | 360 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the ratios. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
compound | bool | Whether the growth is the compound annual growth rate over the lag (e.g. lag=5 for the five-year CAGR) instead of the total change. Defaults to False. | False |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |
trailing | int | The number of periods to sum flows (income and cash flow statement items) over, with balance sheet items averaged over the same number of period ends. E.g. 4 with quarterly data gives the trailing twelve months (TTM) and 3 with annual data a three-year cumulative figure. Defaults to None, which uses single-period flows (per quarter and not annualized with quarterly data). | 4 |