diff --git a/app/cron_info_text.py b/app/cron_info_text.py index 64afbb3..02c0ca2 100644 --- a/app/cron_info_text.py +++ b/app/cron_info_text.py @@ -528,6 +528,14 @@ data = { "text": "The inventory turnover ratio measures how many times inventory has been sold and replaced during a time period.", "equation": "Inventory Turnover Ratio = Cost of Revenue / Average Inventory", }, + "ebitMargin": { + "text": "EBIT Margin is a profitability ratio that measures the percentage of revenue left as EBIT (Earnings Before Interest and Taxes).", + "equation": "EBIT Margin = (EBIT / Revenue) * 100%", + }, + "operatingMargin": { + "text": "Operating margin is the percentage of revenue left as operating income, after subtracting cost of revenue and all operating expenses from the revenue.", + "equation": "Operating Margin = (Operating Income / Revenue) * 100%", + }, } diff --git a/app/restart_json.py b/app/restart_json.py index ce5e953..75f4c0a 100755 --- a/app/restart_json.py +++ b/app/restart_json.py @@ -377,9 +377,14 @@ def get_financial_statements(item, symbol): item['interestIncomeToCapitalization'] = None try: - item['ebit'] = item['operatingIncome'] + item['ebit'] = item['operatingIncome'] + item['operatingMargin'] = round((item['operatingIncome'] / item['revenue']) * 100,2) + item['ebitMargin'] = item['operatingMargin'] except: item['ebit'] = None + item['operatingMargin'] = None + item['ebitMargin'] = None + return item