Skip to content

Commit

Permalink
增加 字典数据。
Browse files Browse the repository at this point in the history
  • Loading branch information
“yhy” committed Jul 9, 2020
1 parent 66c0ad5 commit a0de9c6
Show file tree
Hide file tree
Showing 2 changed files with 358 additions and 123 deletions.
123 changes: 0 additions & 123 deletions libs/stock_web_dic.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,66 +19,6 @@ def __init__(self, mode, type, name, table_name, columns, column_names, primary_

STOCK_WEB_DATA_LIST = []

STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="宏观经济数据",
name="存款利率",
table_name="ts_deposit_rate",
columns=["date", "deposit_type", "rate"],
column_names=["日期", "存款类型", "存款利率"],
primary_key=[],
order_by=" date desc "
)
)

STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="宏观经济数据",
name="贷款利率",
table_name="ts_loan_rate",
columns=["date", "loan_type", "rate"],
column_names=["日期", "贷款类型", "存款利率"],
primary_key=[],
order_by=" date desc "
)
)

STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="宏观经济数据",
name="存款准备金率",
table_name="ts_rrr",
columns=["date", "before", "now", "changed"],
column_names=["变动日期", "调整前存款准备金率(%)", "调整后存款准备金率(%)", "调整幅度(%)"],
primary_key=[],
order_by=" date desc "
)
)

STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="宏观经济数据",
name="货币供应量",
table_name="ts_money_supply",
columns=["month", "m2", "m2_yoy", "m1", "m1_yoy", "m0", "m0_yoy", "cd", "cd_yoy", "qm", "qm_yoy", "ftd",
"ftd_yoy", "sd", "sd_yoy", "rests", "rests_yoy"],
column_names=["统计时间", "货币和准货币(广义货币M2)(亿元)", "货币和准货币(广义货币M2)同比增长(%)",
"货币(狭义货币M1)(亿元)", "货币(狭义货币M1)同比增长(%)",
"流通中现金(M0)(亿元)", "流通中现金(M0)同比增长(%)",
"活期存款(亿元)", "活期存款同比增长(%)",
"准货币(亿元)", "准货币同比增长(%)",
"定期存款(亿元)", "定期存款同比增长(%)",
"储蓄存款(亿元)", "储蓄存款同比增长(%)",
"其他存款(亿元)", "其他存款同比增长(%)"
],
primary_key=[],
order_by=" month desc "
)
)

# http://tushare.org/fundamental.html
# 参考官网网站的文档,是最全的。
Expand All @@ -100,69 +40,6 @@ def __init__(self, mode, type, name, table_name, columns, column_names, primary_
)
)

# 业绩报告(主表)
STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="基本面数据",
name="业绩报告(主表)",
table_name="ts_report_data",
columns=["quarter", "code", "name", "eps", "eps_yoy", "bvps", "roe", "epcf", "net_profits",
"profits_yoy", "distrib", "report_date"],
column_names=["季度", "代码", "名称", "每股收益", "每股收益同比(%)", "每股净资产", "净资产收益率(%)", "每股现金流量(元)", ",净利润(万元)",
"净利润同比(%)", "分配方案", "发布日期"
],
primary_key=[],
order_by=" quarter desc "
)
)

# 盈利能力
STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="基本面数据",
name="盈利能力",
table_name="ts_profit_data",
columns=["quarter", "code", "name", "roe", "net_profit_ratio", "gross_profit_rate",
"net_profits", "eps", "business_income", "bips"],
column_names=["季度", "代码", "名称", "净资产收益率(%)", "净利率(%)", "毛利率(%)", "净利润(万元)",
"每股收益", "营业收入(百万元)", "每股主营业务收入(元)"],
primary_key=[],
order_by=" quarter desc "
)
)

STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="基本面数据",
name="营运能力",
table_name="ts_operation_data",
columns=["quarter", "code", "name", "arturnover", "arturndays",
"inventory_turnover", "inventory_days", "currentasset_turnover", "currentasset_days"],
column_names=["季度", "代码", "名称", "应收账款周转率(次)", "应收账款周转天数(天)", "存货周转率(次)", "存货周转天数(天)",
"流动资产周转率(次)", "流动资产周转天数(天)"
],
primary_key=[],
order_by=" quarter desc "
)
)

STOCK_WEB_DATA_LIST.append(
StockWebData(
mode="query",
type="基本面数据",
name="成长能力",
table_name="ts_growth_data",
columns=["quarter", "code", "name", "mbrg", "nprg", "nav", "targ", "epsg", "seg"],
column_names=["季度", "代码", "名称", "主营业务收入增长率(%)", "净利润增长率(%)", "净资产增长率", "总资产增长率",
"每股收益增长率", "股东权益增长率"],
primary_key=[],
order_by=" quarter desc "
)
)

# "code", "name: pchange", "amount", "buy", "bratio", "sell", "sratio", "reason", "date"
# 代码 名称 当日涨跌幅 龙虎榜成交额(万) 买入额(万) 买入占总成交比例 卖出额(万) 卖出占总成交比例 上榜原因 日期

Expand Down
Loading

0 comments on commit a0de9c6

Please sign in to comment.