一行代码获取所有的财务指标数据
财务指标数据返回字段
列名 | 列的含义 |
---|---|
code | 股票代码 |
pubDate | 日期 |
statDate | 日期 |
eps | 每股收益EPS(元) |
adjusted_profit | 扣除非经常损益后的净利润(元) |
operating_profit | 经营活动净收益(元) |
value_change_profit | 价值变动净收益(元) |
roe | 净资产收益率ROE(%) |
inc_return | 净资产收益率(扣除非经常损益)(%) |
roa | 总资产净利率ROA(%) |
net_profit_margin | 销售净利率(%) |
gross_profit_margin | 销售毛利率(%) |
expense_to_total_revenue | 营业总成本/营业总收入(%) |
operation_profit_to_total_revenue | 营业利润/营业总收入(%) |
net_profit_to_total_revenue | 净利润/营业总收入(%) |
operating_expense_to_total_revenue | 营业费用/营业总收入(%) |
ga_expense_to_total_revenue | 管理费用/营业总收入(%) |
financing_expense_to_total_revenue | 财务费用/营业总收入(%) |
operating_profit_to_profit | 经营活动净收益/利润总额(%) |
invesment_profit_to_profit | 价值变动净收益/利润总额(%) |
adjusted_profit_to_profit | 扣除非经常损益后的净利润/归属于母公司所有者的净利润(%) |
goods_sale_and_service_to_revenue | 销售商品提供劳务收到的现金/营业收入(%) |
ocf_to_revenue | 经营活动产生的现金流量净额/营业收入(%) |
ocf_to_operating_profit | 经营活动产生的现金流量净额/经营活动净收益(%) |
inc_total_revenue_year_on_year | 营业总收入同比增长率(%) |
inc_total_revenue_annual | 营业总收入环比增长率(%) |
inc_revenue_year_on_year | 营业收入同比增长率(%) |
inc_revenue_annual | 营业收入环比增长率(%) |
inc_operation_profit_year_on_year | 营业利润同比增长率(%) |
inc_operation_profit_annual | 营业利润环比增长率(%) |
inc_net_profit_year_on_year | 净利润同比增长率(%) |
inc_net_profit_annual | 净利润环比增长率(%) |
inc_net_profit_to_shareholders_year_on_year | 归属母公司股东的净利润同比增长率(%) |
inc_net_profit_to_shareholders_annual | 归属母公司股东的净利润环比增长率(% |
获取某一天所有的财务指标数据
# 获取“2021-01-05”所有的财务指标数据 df=get_fundamentals(query(indicator),date="2021-01-05") print(df[:4]) # 输出 id code day pubDate statDate eps \ 0 45000708 000001.XSHE 2021-01-05 2020-10-22 2020-09-30 0.4493 1 45590101 000002.XSHE 2021-01-05 2020-10-30 2020-09-30 0.6331 2 45590317 000004.XSHE 2021-01-05 2020-10-30 2020-09-30 0.3324 3 45406174 000005.XSHE 2021-01-05 2020-10-29 2020-09-30 0.0043 adjusted_profit operating_profit value_change_profit roe \ 0 8.730000e+09 1.041200e+10 8.570000e+08 2.46 1 6.775110e+09 1.379713e+10 1.785868e+09 3.69 2 5.469821e+07 6.525505e+07 NaN 3.86 3 -1.787463e+07 -1.747028e+07 4.047380e+07 0.28 ... inc_total_revenue_year_on_year \ 0 ... 8.8400 1 ... 12.4700 2 ... 17929.4004 3 ... -41.6200 inc_total_revenue_annual inc_revenue_year_on_year inc_revenue_annual \ 0 -5.36 8.8400 -5.36 1 -3.48 12.4700 -3.48 2 209.31 17929.4004 209.31 3 -3.07 -41.6200 -3.07 inc_operation_profit_year_on_year inc_operation_profit_annual \ 0 5.51 69.1000 1 10.53 -28.2900 2 745.37 6337.2998 3 138.08 155.5600 inc_net_profit_year_on_year inc_net_profit_annual \ 0 6.11 69.9800 1 22.97 -29.3600 2 721.89 3654.3401 3 143.59 151.5400 inc_net_profit_to_shareholders_year_on_year \ 0 6.11 1 14.94 2 783.92 3 132.08 inc_net_profit_to_shareholders_annual 0 69.9800 1 -34.6700 2 4519.6099 3 140.9000 [4 rows x 36 columns]
结合上表的字段,获取一只股票某个字段数据
q = query( indicator ).filter( indicator.code == '000004.XSHE' ) df = get_fundamentals(q, '2015-10-15') # 打印出每股收益EPS(元) print(df['eps'][0]) >>>0.0365
获取多只股票在某一日期的财务数据
df = get_fundamentals(query( indicator ).filter( # 这里不能使用 in 操作, 要使用in_()函数 indicator.code.in_(['000001.XSHE', '600000.XSHG']) ), date='2015-10-15') print(df) # 输出 id code day pubDate statDate eps \ 0 178 000001.XSHE 2015-10-15 2015-08-14 2015-06-30 0.4162 1 2952806 600000.XSHG 2015-10-15 2015-08-20 2015-06-30 0.6813 adjusted_profit operating_profit value_change_profit roe \ 0 5.954000e+09 6.254000e+09 1.566000e+09 4.14 1 1.239500e+10 1.553200e+10 8.140000e+08 4.45 ... inc_total_revenue_year_on_year \ 0 ... 39.02 1 ... 19.94 inc_total_revenue_annual inc_revenue_year_on_year inc_revenue_annual \ 0 25.32 39.02 25.32 1 14.30 19.94 14.30 inc_operation_profit_year_on_year inc_operation_profit_annual \ 0 17.90 5.01 1 4.92 12.52 inc_net_profit_year_on_year inc_net_profit_annual \ 0 18.69 5.81 1 6.29 13.33 inc_net_profit_to_shareholders_year_on_year \ 0 18.69 1 6.39 inc_net_profit_to_shareholders_annual 0 5.81 1 13.53 [2 rows x 36 columns]