数据管理|数据库

日期数据维护


功能:通过times.py中的 ,从windapi提取日期数据,对日、周、月、季日期数据进行维护
数据形式:上交所的交易日数据,日、周末、月末、季度末;其中周末、月末含每一年的第几周、第几个月
notes:note:月末不一定是当周周末交易日!
input=ouput:日期列表文件:file=C:\rc_2023\rc_202X\ciss_web\CISS_rc\db\db_times\date_trade.xlsx



证券代码数据


证券代码数据表通常保存在以下几类文件:
1,基于内部策略:内部数据目录下、或对应单个策略的代码列表,如 C:\rc_2023\rc_202X\data_pms\wind_terminal\quote\0list_code.xlsx
2,基于外部数据:各类终端导出、落地数据库内的的代码列表、
3,基于外部规则的数据:指数成分股、特定代码列表例如基金季度持仓股票、机构调研列表等。

  • 重要代码表文件
    多资产代码表,0list_code.xlsx
    0list_code.xlsx

  • 策略和组合数据


    策略和组合对应文件,file=C:\rc_2023\rc_202X\data_pms\pms_manage.xlsx
    指标-基金筛选指标文件,file=C:\rc_2023\rc_202X\data_pms\fund_indi_manage.xlsx


    简要涨跌幅数据表维护

    基于给定的日期列表,股票代码列表,通过本地各类excel数据文件,存入统一的涨跌幅数据表,格式为index=日期,column=code
    数据表格table_name = quote_ashares_stock_fund_index | db_name=db_quote.sqlite3
    管理文件,file=C:\rc_2023\rc_202X\data_ciss_exhi\manage_db_quote.xlsx


    Windapi提取区间行情数据


    逻辑:给定代码列表文件,对每个代码文件,提取缺失的的区间行情数据,主要是收盘价和涨跌幅。
    1,核心资产 |0list_code.xlsx;path=C:\rc_2023\rc_202X\data_pms\wind_terminal\quote
    2,

    选择代码文件

    导入历史个券代码文件

    根据股票代码列表和日期区间,提取相关的数据
    代码列表文件:sheet_name=code_list,date_list; file=C:\rc_2023\rc_202X\data_ciss_exhi\manage_db_quote.xlsx
    OUTPUT:1,excel-log文件,index是日期,column=code,数据完整1,不完整0.5,无数据0;
    2, 数据文件按年保存成sqlite.db和
    notes:1,短期数据可通过windapi实现跟踪交易日的涨跌幅,定期长期历史数据可以通过tb-大富翁数据获取。
    2,确保从wind终端的K线图导出时,列名为【代码 名称 日期 开盘价(元) 最高价(元) 最低价(元) 收盘价(元) 涨跌幅 成交额(百万) 成交量(股) 】

    代码数据格式:若选个券:单一代码:
    指标类型:

    导入历史日期文件

    选中不同数据来源后,根据目录内的文件名导入数据
    也可以限制代码范围或日期范围:sheet_name=code_list,date_list; file=C:\rc_2023\rc_202X\data_ciss_exhi\manage_db_quote.xlsx
    notes:短期数据可通过windapi实现跟踪交易日的涨跌幅,定期长期历史数据可以通过tb-大富翁数据获取。

    数据来源:日期数据格式:若选1日期若选2日期区间:开始日期结束日期
    指标类型:

    涨跌幅数据完整性:指定代码列表或日期区间

    TODO:print 区间内股票数量、交易日数量,百分比
    INPUT:给定代码列表、日期列表,查询无记录项,返回 df_missing(index=dates,columns=code_list)
    OUTPUT: input_db_quote_check_completeness_by_code_date


    修改或删除数据:


    行情数据库=db_quote.sqlite3


    定期维护从各个数据源获得的数据库


    查询数据完整性:指定代码列表或日期区间

    input:代码列表=code_list, sheet=code_list,file=C:\rc_2023\rc_202X\data_ciss_exhi\manage_db_quote.xlsx
    output:table=quote_ashares_stock_fund_index;file=db_quote.sqlite3
    参考资料:历史日期列表文件:file=C:\rc_2023\rc_202X\ciss_web\CISS_rc\db\db_times\date_trade.xlsx
    TODO:print 区间内股票数量、交易日数量,百分比


    基本面数据库=db_funda.sqlite3;db_quote


    主要通过以下数据网页维护:
    Layui-宏观基本面信息;MultiAsset and Macro|layui-table
    Layui-行业、风格、市场分析;Industry-Style-Market|layui-table
    Layui-个券基本面跟踪;Stock Fundamentals|layui-table
    基本面事件和股票池,包含上述3个
    layui-基金和FOF研究


    数据资源介绍


    核心数据目录包括:

        CISS_db,项目对应的数据库;path=C:\rc_2023\rc_202X\CISS_db,D:\CISS_db
        其他:1,大智慧历史财务数据,截至20181021,path=D:\db_dzh_dfw;
        db_wind:Wind落地数据库和hs,yes等;path=D:\db_wind

    外部数据库和对应本地目录:

        0,Wind-api数据,每周限制50万个数值;path=C:\rc_2023\rc_202X\data_pms\wind_terminal\quote
        0,恒生api,每天58元;path=D:\CISS_db\data_hs
        1,基于Wind落地数据库的分析数据,20030102-20210111;整理过的A股Wind数据,和2差不多,截至20201214;path=D:\db_wind\data_adj\ashare_ana
        2,Wind落地数据库,20030102-20210111;指数数据,AIndexEODPrices只有沪深和中证,没有wind的指数;交易所基金,ChinaClosedFundEODPrice;公募基金,ChinaMutualFundNAV;path=D:\db_wind\data_wds\AShareEODPrices;
        3,通联数据,getMktEqud是个股行情数据,从20201223-20211220;path=D:\db_wind\data_yes\table\getMktEqud
        5,choice数据没有日频,月末A股、美股、基金、指数数据,20070228-20220729;path=C:\rc_2023\rc_202X\data_choice


    数据库管理维护


    功能:新建、调整、删除Sqlite数据库表。
    研究信息网页&表格信息;分类:1,个券事件;2,股票池;3,市场行业风格;4,基金时间序列-主动和指数;5,大类资产;
    task名称 :web网页和sql数据库联动。excel模型来源:file=rc_个券推荐行业事件.xlsx;
    todo:2种数据写入方式:1,逐条手动网页输入;2,上传excel文件,用python脚本批量写入sqlite。


    所有数据库-表table-column 列表
    db table column column_type column_CN note
    db_funda.sqlite3 ciss_exhi_fund_analysis code varchar(20) nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis name text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis date date nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis style_fund text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis theme_fund text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis ind_1 text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis ind_2 text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis ind_3 text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis ind_num int nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis score_performance float(255,2) nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis s_down_market float(255,2) nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis s_flat_market float(255,2) nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis s_up_market float(255,2) nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis abstract_analysis text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis fund_namager text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis note text nan nan
    db_funda.sqlite3 ciss_exhi_fund_analysis date_lastmodify datetime nan nan
    db_funda.sqlite3 event_view_multiasset_macro date datetime 日期 nan
    db_funda.sqlite3 event_view_multiasset_macro asset_market_topic text 资产-市场-数据 nan
    db_funda.sqlite3 event_view_multiasset_macro type_event_view text 类型 nan
    db_funda.sqlite3 event_view_multiasset_macro keyword text 关键词 nan
    db_funda.sqlite3 event_view_multiasset_macro abstract text 概要 nan
    db_funda.sqlite3 event_view_multiasset_macro weight float(255,2) 配置比例 nan
    db_funda.sqlite3 event_view_multiasset_macro source text 来源 nan
    db_funda.sqlite3 event_view_ind_style_market date datetime 代码 nan
    db_funda.sqlite3 event_view_ind_style_market code_index text 指数代码 nan
    db_funda.sqlite3 event_view_ind_style_market name_index text 市场-行业-风格 nan
    db_funda.sqlite3 event_view_ind_style_market type_ind_style text 行业或风格类型 nan
    db_funda.sqlite3 event_view_ind_style_market keyword text 关键词 nan
    db_funda.sqlite3 event_view_ind_style_market abstract text 概要 nan
    db_funda.sqlite3 event_view_stock_funda date datetime 跟踪时间 nan
    db_funda.sqlite3 event_view_stock_funda code text 代码 nan
    db_funda.sqlite3 event_view_stock_funda name text 名称 nan
    db_funda.sqlite3 event_view_stock_funda keyword text 关键词 nan
    db_funda.sqlite3 event_view_stock_funda abstract text 概要 nan
    db_funda.sqlite3 event_view_stock_funda mv_buy_lb text 目标买入市值 nan
    db_funda.sqlite3 event_view_stock_funda mv_sell_ub text 目标卖出市值 nan
    db_funda.sqlite3 event_view_stock_funda source text 来源 nan
    db_funda.sqlite3 fundpool_stockpool_weight date datetime 调入日 nan
    db_funda.sqlite3 fundpool_stockpool_weight pool_name text 证券池类型 主动股票池、量化股票池、量化基金池、主动基金池
    db_funda.sqlite3 fundpool_stockpool_weight pool_level text 核心基础备选 默认为基础池;核心池core、基础池basic、备选池other
    db_funda.sqlite3 fundpool_stockpool_weight type_asset_indstyle_stock text 资产类型 asset、market、ind、style、factor、fund、stock、bond
    db_funda.sqlite3 fundpool_stockpool_weight strategy text 策略 例如主动股票基金池、偏债混合基金池、行业轮动
    db_funda.sqlite3 fundpool_stockpool_weight strategy_CN text 策略名称 例如主动股票基金池、偏债混合基金池、行业轮动
    db_funda.sqlite3 fundpool_stockpool_weight code text 代码 资产、行业指数或个股代码
    db_funda.sqlite3 fundpool_stockpool_weight name text 名称 资产、行业指数或个股名称
    db_funda.sqlite3 fundpool_stockpool_weight weight text 权重 基金权重1~9%、个股0.3%~6%
    db_funda.sqlite3 fundpool_stockpool_weight code_fund text 基金代码 匹配市场、行业、风格的基金代码
    db_funda.sqlite3 fundpool_stockpool_weight code_stock text 股票代码 匹配市场、行业、风格的股票代码
    db_funda.sqlite3 fundpool_stockpool_weight note text note 备注
    db_quote.sqlite3 quote_date_trade exchange text 交易所 默认SSE=上交所
    db_quote.sqlite3 quote_date_trade date datetime 交易日 nan
    db_quote.sqlite3 quote_date_trade num_date int 日期数字 取值范围:d:1~7 ;w:1~52;m:1~12 ;q:1~4 ;
    db_quote.sqlite3 quote_date_trade type_date text 日期类型 取值范围:d,w,m,q,y;day,week,month,quarter,year
    db_quote.sqlite3 quote_ashares_stock_fund_index_month date datetime 交易日 只保存月末节点数据
    db_quote.sqlite3 quote_ashares_stock_fund_index_month code text 代码 基金主要指的是场内交易的基金
    db_quote.sqlite3 quote_ashares_stock_fund_index_month name text 名称 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month type_asset text 证券类型 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month type_period text 指标区间 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month pre_close float(255,2) 前收盘价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month close float(255,2) 收盘价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month high float(255,2) 最高价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month low float(255,2) 最低价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month amt float(255,2) 月成交额 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month pct_chg float(255,2) 涨跌幅 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month ma16 float(255,2) ma16 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month ma16_pre float(255,2) ma16_pre nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month ma40 float(255,2) ma40 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month ma100 float(255,2) ma100 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month pe_ttm float(255,2) pe_ttm nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month pb_mrq float(255,2) pb_mrq nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month pcf_ocf_ttm float(255,2) pcf_ocf_ttm nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month mkt_cap float(255,2) 总市值 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month estpe_FY1 float(255,2) 预测PE_FY1 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month estpe_FY2 float(255,2) 预测PE_FY2 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month estpeg_FY1 float(255,2) 预测PEG_FY1 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month estpeg_FY2 float(255,2) 预测PEG_FY2 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month west_netprofit_YOY float(255,2) 一致预测净利润同比 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month west_avgnp_yoy float(255,2) 一致预测净利润同比FY2比FY1 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month west_sales_YOY float(255,2) 一致预测营业收入同比 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index_month west_sales_CAGR float(255,2) 一致预测营业收入2年复合增长率 nan
    db_quote.sqlite3 quote_fund_month date datetime 交易日 交易日只需要涨跌幅和成交金额
    db_quote.sqlite3 quote_fund_month code text 代码 nan
    db_quote.sqlite3 quote_fund_month name text 名称 nan
    db_quote.sqlite3 quote_fund_month type_asset text 证券类型 nan
    db_quote.sqlite3 quote_fund_month type_period text 指标区间 nan
    db_quote.sqlite3 quote_fund_month return_m float(255,2) 涨跌幅 nan
    db_quote.sqlite3 quote_fund_month nav float(255,2) 基金净值 nan
    db_quote.sqlite3 quote_fund_month NAV_adj float(255,2) 基金净值复权 nan
    db_quote.sqlite3 quote_fund_month netasset_total float(255,2) 基金规模合计 nan
    db_quote.sqlite3 quote_fund_month peer_fund_return_rank_prop_per float(255,2) 同类基金区间收益排名(百分比) nan
    db_quote.sqlite3 quote_fund_month periodreturnranking_1m text 近1月回报排名 2/1992
    db_quote.sqlite3 quote_fund_month periodreturnranking_ytd text 今年以来回报排名 132/1992
    db_quote.sqlite3 quote_ashares_stock_fund_index date datetime 交易日 交易日只需要涨跌幅和成交金额
    db_quote.sqlite3 quote_ashares_stock_fund_index code text 代码 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index name text 名称 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index type_asset text 证券类型 标的类型:A股指数、个股、场内基金行情,stock_fund_index;
    db_quote.sqlite3 quote_ashares_stock_fund_index type_period text 指标区间 日day,周week,月month
    db_quote.sqlite3 quote_ashares_stock_fund_index pre_close float(255,2) 前收盘价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index close float(255,2) 收盘价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index high float(255,2) 最高价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index low float(255,2) 最低价 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index amt float(255,2) 月成交额 nan
    db_quote.sqlite3 quote_ashares_stock_fund_index pct_chg float(255,2) 涨跌幅 nan


    新建或删除Sqlite表格

    表格生成方式gen_type有2种:1,dict,根据输入的字典dict_column构建;2,excel:根据sheet里导入的df表格构建
    Excel方式:先在Excel文件中定义表格名称和columns;sheet=table_column;file=C:\rc_2023\rc_202X\ciss_web\ciss_exhi\db_manage.xlsx
    Dict方式:输入 新建表格dict内 内容
    notes:1,sheet=table_column中,包含了 所有表格建立时的column设置;sheet=table_column,file=C:\rc_2023\rc_202X\ciss_web\ciss_exhi\db_manage.xlsx
    2,若使用dict方式新建表格,需要确保输入字符串 str1,满足 type( eval(str1) ) = dict,例如 str1= "{'name' : 'jim', 'sex' : 'male', 'age': 18}"

    数据库选择新建或删除表格新建表格方式新建表格dict的字符串版本 |若excel不用写
    表格名称:

    结果:


    删除Sqlite表格内,部分列的值相同的重复项,并保留最小的id

    step 1:选出某几列数值相同的列的最大的id值
    step 2:根据返回的列的id,逐一删除sql中的记录

    数据库选择若选其他,直接输入数据库全名如 db_quote_2019.sqlite3 :
    表格名称:例如quote_ashares_stock_fund_index:
    输入列名列表","隔开,例如date,code:

    结果:


    Excel批量导入Sqlite:数据从excel-sheet 导入 sqlite-table

    给定表格名称和数据源,将excel文件中数据导入sqlite的table
    Notes:注意将文本内容里的空格删除、单引号用^替代

    外部Excel文件位置(默认):Excel文件名称Excel-Sheet名称
    数据库选择:表格名称table:

    结果:


    新建Sqlite数据库

    例子:conn = sqlite3.connect("test.db") #连接数据库,若test.db不存在,则会创建该数据库

    输入数据库名称:

    细分数据

    1,概要


    {......}
    通过FileGee文件同步备份软件对2~7类数据目录进行维护,但较大的数据文件目录(db_wind) 可能发生同步不准确的情况。


    2,CISS模块包 |ciss_web

    主目录主要包括【CISS_rc,ciss_web,ciss_exhi,static,ciss_vue】,其中:
    CISS_rc:各类策略应用apps、策略引擎bin、配置文件config、数据管理db、文档docs、测试脚本tests、
    ciss_web:Django网站相关python脚本
    ciss_exhi:用于网页展示投研系统、策略、数据的python脚本
    static:静态网页html,javaScript,csv和json文件
    ciss_vue:前端框架vue及相关文件。


    3,内部研究报告 |rc_reports_cs

    个人或团队在当前所在机构完成和维护的各类报告。


    4,CISS数据库 |CISS_db

    保存CISS系统策略计算输出的数据文件,例如主动基准模型ABM的各个组合、动量策略40d_16d的 各个组合。
    notes:历史组合数据因为设计成保存每日持仓和交易文件,单个组合大小可以达到1gb,有较大的改进空间。

    主要数据目录【D:\CISS_db\】包括:

    1. 主动基准模型、行业历史成长锚和价值锚股票权重 |Active_Benchmark_Model_2019
    2. 债券指数历史百分位策略 |bond_pct
    3. PostgreSql数据库 |ciss_db
    4. 中证800行业轮动策略 |csi800_industrial_rotation
    5. cs指数增强策略 |data_applications
    6. ETF数据相关 |data_csi
    7. BL资产配置课题相关数据:csi800成分、买方和卖方观点 |db_bl

    5,外部研究报告 |TOUYAN

    买方和卖方研究报告:行业、宏观、量化、债券、基金等

    每周基金排名

    主要有海通、中信每周邮件发送基金排名数据 文件:海通证券-基金业绩排行榜(2020-02-09)(更新版).xlsx;海通证券-基金超额收益排行榜(20200209).xlsx 文件:中信证券 公募基金仓位监测数据20200207.xlsx 文件位置:D:\TOUYAN\基金排名


    6,Wind数据库 |db_wind

  • data_wds |wds原始表格数据按表格名称目录保存
  • data_adj |经过处理的wds数据信息,如基金分析目录fund_ana、个券历史行业分类数据industries_class
  • wind_data |wind-api获取的csi300,500,1000历史权重和成分数据,2006-201811
  • FICC_raw,index |固定收益类wds数据,债券指数数据
  • financialdata_summary,quote_us |Wind终端导出的美股财务数据,部分港股和美股的历史开盘收盘成交量数据
  • Factset |从Factset获取的数据
  • 1min |201810之前A股1分钟数据
  • Wind终端数据获取

    Wind终端可以高效地获取许多梳理后地数据,并避免重复劳动。但问题在于Wind终端通常 只提供最新的专题数据,并且某些时效性高的新内容不能马上获得。例如200214在线办公产业链 很热门,但是在板块股票列表中还没有。

    1. 获取股票|基金|指数列表:Wind终端——股票——板块报价——全部A股;左侧栏选择行业、概念、产业链
    获取指数成分股票

    指数成分股票:数据来源:Wind终端——股票——板块报价 沪深股票: 科创板——按科创板主题行业 中信证券行业类: 中信证券特殊类:CS行业类别{金融地产、资源能源、原材料、设备制造、工业服务、交通运输、消费、科技};风格{金融、周期、消费、成长、稳定} 地域类:福建——福州 美国股票——美股指数成分: 标普指数:SP500、标普100、标普中型股400、标普小型股600 其他指数:费城半导体指数SOX.GI;罗素1000,2000,3000

    基金筛选方法:

    基金筛选方法: 基金:基金概念类——按投资标的分(概念类),有MSCI和科创板等但行业分类只有消费、环保、医疗 基金:Wind主题基金——Wind行业板块主题基金,Wind概念板块主题基金。感觉可能是以持仓股是否最多属于该板块来定的, 美股:全球股票——中国概念股——美国中资产业类;主要包括:网络游戏、电子商务、互联网、SNS社交网络、房地产、新能源、互联网视频、生物技术、制药、文化传媒。 数据来源:Wind终端——股票——板块报价


    7,其他数据库 | others


    Facset数据 | D:\db_factset
    2018Q3之前财务和权息数据4abm model | D:\db_dzh_dfw
    论文目录 | D:\paper
    python相关模块 | H:\py_modules
    相关软件 | H:\softs


    默认数据库Sqlite3:file=db.sqlite3

    常用功能:1,Python连接: path="C:\\rc_HUARONG\\rc_HUARONG\\ciss_web\\" ;file="db.sqlite3";import sqlite3;conn = sqlite3.connect(path+file); c =conn.cursor()
    2,获取所有表名称:1,c.execute("select name from sqlite_master where type='table' order by name"); list = c.fetchall(); type(list[0]) ==tuple; type(list[0][0]) ==str,
    [('auth_group',), ('auth_group_permissions',), ('auth_permission',), ('auth_user',), ('auth_user_groups',), ('auth_user_user_permissions',), ('ciss_exhi_asset',), ('ciss_exhi_basics',), ('ciss_exhi_bond',), ('ciss_exhi_bond_derivative',), ('ciss_exhi_cash_tool',), ('ciss_exhi_db',), ('ciss_exhi_group',), ('ciss_exhi_index',), ('ciss_exhi_index_derivative',), ('ciss_exhi_membership',), ('ciss_exhi_multi_asset',), ('ciss_exhi_person',), ('ciss_exhi_portfolio',), ('ciss_exhi_stock',), ('ciss_exhi_stock_derivative',), ('ciss_exhi_stra_port_links',), ('ciss_exhi_strategy',), ('ciss_exhi_user_ciss',), ('django_admin_log',), ('django_content_type',), ('django_migrations',), ('django_session',), ('sqlite_sequence',)]


    8,数据备份 |

    file_name |file_path
    D:\CISS_db_backup
    D:\db_wind_备用


    9,基本面数据:db_funda.sqlite3

    其他个性化数据目录:

    sqlite3新增数据库

    1,新建数据库文件,也可以直接复制'db.sqlite3'
    2,数据库配置:"settings.py"文件中DATABASES = {}设置: "ciss_db":{ 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db_funda.sqlite3'), },
    3,设置数据库的路由规则:


    10,数据交互和展示

    基本面和行业研究等定性数据,特别是特定的数据表格,截至t时间的数据可能在未来t+1, t+2的时间都需要对图表加入数据并更新。基于目前的技术能力和时间成本,可以主要用
    “Excel-原始数据处理 --> csv标准数据--> python脚本转换成json --> html展示json数据”