add more rules

This commit is contained in:
MuslemRahimi 2024-10-26 15:34:15 +02:00
parent eff1428d1d
commit dca7d93f62
2 changed files with 14 additions and 1 deletions

View File

@ -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%",
},
}

View File

@ -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