コード例 #1
0
ファイル: fx_demo.py プロジェクト: 18505161903/fwshare
# encoding: utf-8

from opendatatools import fx

if __name__ == '__main__':
    # 人民币汇率中间价历史数据
    df, msg = fx.get_hist_cny_cpr()
    print(df[['date', 'USD/CNY']])

    # # shibor历史数据
    # df, msg = fx.get_his_shibor()
    # print(df)
    #
    # # shibor实时数据
    # df = fx.get_realtime_shibor()
    # print(df)
    #
    # # 人民币汇率最新数据
    # df = fx.get_cny_spot_price()
    # print(df)
コード例 #2
0
ファイル: fx_demo.py プロジェクト: taoyeah/Sharefloder
# encoding: utf-8

from opendatatools import fx

if __name__ == '__main__':
    # 人民币汇率中间价历史数据
    df,msg = fx.get_hist_cny_cpr(start_date='2016-01-01')
    print(df.head(10))

    # shibor历史数据
    df, msg = fx.get_his_shibor(start_date='2016-01-01')
    print(df)

    # shibor实时数据
    #df = fx.get_realtime_shibor()
    #print(df)

    # 人民币汇率最新数据
    #df = fx.get_cny_spot_price()
    #print(df)
コード例 #3
0
ファイル: quantos.py プロジェクト: zhqagp/quantos_rpc
def fx_get_hist_cny_cpr():
    df, msg = fx.get_hist_cny_cpr(start_date=request.form['start_date'],
                                  end_date=request.form['end_date'])
    return df.to_json(orient='table')
コード例 #4
0
    def test_get_his_cny_cpr(self):
        df, msg = fx.get_hist_cny_cpr()
        assert (len(df) >= 100)

        df, msg = fx.get_hist_cny_cpr('2017-01-01', '2018-05-01')
        assert (df == None)