开源工具系列-(你的公司踩商誉减值的雷了吗)商誉与净利润分析工具
author: aaron-clark-aic
这货的其他文章目录
这周最热门的是什么?是很多公司年报大幅计提商誉,你经历过业绩大变脸吗?
这个小工具帮你计算下你的公司到底有多少商誉,你的净利润足够计提吗?
import datetime
class Stocks:
def combineIdustryStocks(self,industries:list):
return np.hstack([get_industry_stocks(i) for i in industries])
def standardStocks(self,stockList):
_stocks = list(get_all_securities('stock').index)
_standardStocks = []
for i in stockList:
_standardStocks =_standardStocks [code for code in _stocks if code.upper().startswith(i)]
return _standardStocks
class Goodwill:
def get(self,stock):
df = get_fundamentals(
query(balance.good_will,
income.net_profit,
(balance.good_will/income.net_profit)*100
).filter(
valuation.code == stock,
).order_by(
), date=datetime.date.today())
return [('商誉(元)',df['good_will'].values[0]),('净利润(元)',df['net_profit'].values[0]),('商誉占净利润百分比%',df['anon_1'].values[0])]
_st = Stocks()
_gd = Goodwill()
print(_gd.get(stock=_st.standardStocks(stockList=['002422'])[0]))
[('商誉(元)', 26133366.0), ('净利润(元)', 108361032.0), ('商誉占净利润百分比%', 24.11694086)]