akshare 1.14.49__py3-none-any.whl → 1.17.99__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- akshare/__init__.py +595 -129
- akshare/air/air_hebei.py +77 -54
- akshare/air/air_zhenqi.py +0 -4
- akshare/air/cons.py +1 -0
- akshare/air/crypto.js +1 -1
- akshare/air/outcrypto.js +1 -1
- akshare/article/cons.py +1 -0
- akshare/article/epu_index.py +4 -3
- akshare/article/ff_factor.py +19 -8
- akshare/article/fred_md.py +4 -1
- akshare/article/risk_rv.py +3 -8
- akshare/bank/bank_cbirc_2020.py +11 -11
- akshare/bank/cons.py +7 -6
- akshare/bond/bond_buy_back_em.py +228 -0
- akshare/bond/bond_cb_sina.py +1 -0
- akshare/bond/bond_cb_ths.py +17 -9
- akshare/bond/bond_cbond.py +19 -14
- akshare/bond/bond_china.py +38 -39
- akshare/bond/bond_china_money.py +1 -1
- akshare/bond/bond_convert.py +10 -9
- akshare/bond/bond_em.py +37 -17
- akshare/bond/bond_summary.py +38 -37
- akshare/bond/bond_zh_cov.py +31 -40
- akshare/bond/bond_zh_sina.py +4 -0
- akshare/bond/cons.py +14 -11
- akshare/cal/__init__.py +0 -0
- akshare/cal/rv.py +170 -0
- akshare/cost/cost_living.py +7 -5
- akshare/crypto/__init__.py +1 -1
- akshare/crypto/crypto_bitcoin_cme.py +9 -7
- akshare/crypto/crypto_hold.py +4 -2
- akshare/currency/currency.py +1 -0
- akshare/currency/currency_china_bank_sina.py +11 -6
- akshare/data/__init__.py +1 -1
- akshare/data/cninfo.js +1 -1
- akshare/datasets.py +10 -21
- akshare/economic/cons.py +10 -3
- akshare/economic/macro_australia.py +74 -69
- akshare/economic/macro_bank.py +95 -653
- akshare/economic/macro_canada.py +92 -81
- akshare/economic/macro_china.py +97 -105
- akshare/economic/macro_china_hk.py +0 -1
- akshare/economic/macro_euro.py +103 -56
- akshare/economic/macro_finance_ths.py +7 -5
- akshare/economic/macro_germany.py +1 -1
- akshare/economic/macro_japan.py +0 -1
- akshare/economic/macro_other.py +1 -6
- akshare/economic/macro_swiss.py +2 -3
- akshare/economic/macro_uk.py +1 -1
- akshare/economic/macro_usa.py +7 -9
- akshare/economic/marco_cnbs.py +11 -6
- akshare/energy/energy_carbon.py +0 -1
- akshare/energy/energy_oil_em.py +1 -2
- akshare/event/cons.py +1 -0
- akshare/exceptions.py +43 -0
- akshare/file_fold/calendar.json +245 -2
- akshare/forex/__init__.py +0 -0
- akshare/forex/cons.py +192 -0
- akshare/forex/forex_em.py +149 -0
- akshare/fortune/fortune_500.py +1 -37
- akshare/fortune/fortune_bloomberg.py +6 -3
- akshare/fortune/fortune_forbes_500.py +3 -6
- akshare/fortune/fortune_hurun.py +2 -1
- akshare/fortune/fortune_xincaifu_500.py +17 -14
- akshare/fund/fund_announcement_em.py +145 -0
- akshare/fund/fund_aum_em.py +49 -35
- akshare/fund/fund_em.py +251 -220
- akshare/fund/fund_etf_em.py +44 -35
- akshare/fund/fund_etf_sina.py +75 -27
- akshare/fund/fund_etf_ths.py +2 -0
- akshare/fund/fund_fee_em.py +172 -0
- akshare/fund/fund_fhsp_em.py +42 -32
- akshare/fund/fund_init_em.py +8 -5
- akshare/fund/fund_lof_em.py +12 -19
- akshare/fund/fund_manager.py +25 -11
- akshare/fund/fund_overview_em.py +42 -0
- akshare/fund/fund_portfolio_em.py +23 -21
- akshare/fund/fund_position_lg.py +19 -8
- akshare/fund/fund_rank_em.py +2 -5
- akshare/fund/fund_rating.py +33 -12
- akshare/fund/fund_scale_em.py +24 -13
- akshare/fund/fund_scale_sina.py +20 -10
- akshare/fund/fund_xq.py +3 -2
- akshare/futures/cons.py +135 -39
- akshare/futures/cot.py +55 -56
- akshare/futures/futures_basis.py +49 -11
- akshare/futures/futures_comex_em.py +1 -0
- akshare/futures/futures_comm_ctp.py +1 -1
- akshare/futures/futures_contract_detail.py +59 -9
- akshare/futures/futures_daily_bar.py +66 -59
- akshare/futures/futures_foreign.py +14 -8
- akshare/futures/futures_hf_em.py +215 -61
- akshare/futures/futures_hist_em.py +191 -0
- akshare/futures/futures_hq_sina.py +5 -3
- akshare/futures/futures_index_ccidx.py +24 -82
- akshare/futures/futures_inventory_99.py +70 -272
- akshare/futures/futures_inventory_em.py +14 -11
- akshare/futures/futures_news_shmet.py +2 -2
- akshare/futures/futures_roll_yield.py +11 -24
- akshare/futures/futures_rule.py +7 -3
- akshare/futures/futures_rule_em.py +38 -0
- akshare/futures/futures_settlement_price_sgx.py +21 -6
- akshare/futures/futures_stock_js.py +0 -1
- akshare/futures/futures_to_spot.py +5 -6
- akshare/futures/futures_warehouse_receipt.py +48 -47
- akshare/futures/futures_zh_sina.py +3 -3
- akshare/futures/receipt.py +298 -165
- akshare/futures/requests_fun.py +16 -3
- akshare/futures/symbol_var.py +32 -13
- akshare/futures_derivative/cons.py +100 -103
- akshare/futures_derivative/futures_contract_info_cffex.py +55 -39
- akshare/futures_derivative/futures_contract_info_czce.py +2 -0
- akshare/futures_derivative/futures_contract_info_dce.py +43 -17
- akshare/futures_derivative/futures_contract_info_gfex.py +43 -31
- akshare/futures_derivative/futures_contract_info_ine.py +43 -34
- akshare/futures_derivative/futures_contract_info_shfe.py +3 -4
- akshare/futures_derivative/futures_cot_sina.py +8 -6
- akshare/futures_derivative/futures_index_sina.py +25 -13
- akshare/fx/cons.py +12 -7
- akshare/fx/fx_c_swap_cm.py +62 -0
- akshare/fx/fx_quote.py +3 -2
- akshare/fx/fx_quote_baidu.py +2 -1
- akshare/hf/__init__.py +1 -1
- akshare/hf/hf_sp500.py +8 -7
- akshare/index/cons.py +132 -28
- akshare/index/index_cni.py +7 -7
- akshare/index/index_cons.py +2 -2
- akshare/index/index_csindex.py +68 -0
- akshare/index/index_cx.py +20 -20
- akshare/index/index_drewry.py +17 -16
- akshare/index/index_eri.py +1 -0
- akshare/index/index_global_em.py +167 -0
- akshare/index/index_global_sina.py +82 -0
- akshare/index/index_kq_fz.py +17 -14
- akshare/index/index_kq_ss.py +1 -0
- akshare/index/index_option_qvix.py +351 -16
- akshare/index/index_research_sw.py +21 -21
- akshare/index/index_spot.py +9 -5
- akshare/index/index_stock_hk.py +5 -9
- akshare/index/index_stock_zh.py +111 -24
- akshare/index/index_stock_zh_csindex.py +3 -367
- akshare/index/index_sugar.py +18 -4
- akshare/index/index_sw.py +10 -2
- akshare/index/index_yw.py +53 -75
- akshare/index/index_zh_em.py +15 -82
- akshare/interest_rate/interbank_rate_em.py +0 -1
- akshare/movie/jm.js +0 -1
- akshare/news/__init__.py +1 -1
- akshare/news/news_baidu.py +395 -222
- akshare/news/news_stock.py +49 -16
- akshare/option/cons.py +2 -2
- akshare/option/option_commodity.py +341 -220
- akshare/option/option_commodity_sina.py +22 -26
- akshare/option/option_contract_info_ctp.py +63 -0
- akshare/option/option_current_sse.py +61 -0
- akshare/option/option_current_szse.py +84 -0
- akshare/option/option_czce.py +37 -9
- akshare/option/option_daily_stats_sse_szse.py +0 -1
- akshare/option/option_em.py +4 -8
- akshare/option/option_finance.py +60 -12
- akshare/option/option_finance_sina.py +7 -7
- akshare/option/option_lhb_em.py +0 -1
- akshare/option/option_margin.py +62 -0
- akshare/option/option_premium_analysis_em.py +58 -53
- akshare/option/option_risk_analysis_em.py +11 -8
- akshare/option/option_risk_indicator_sse.py +3 -4
- akshare/option/option_value_analysis_em.py +62 -55
- akshare/other/__init__.py +1 -1
- akshare/pro/__init__.py +0 -1
- akshare/pro/client.py +6 -4
- akshare/pro/cons.py +3 -2
- akshare/pro/data_pro.py +6 -5
- akshare/qdii/__init__.py +0 -0
- akshare/qdii/qdii_jsl.py +233 -0
- akshare/qhkc/__init__.py +1 -6
- akshare/qhkc/qhkc_api.py +64 -22
- akshare/qhkc_web/__init__.py +1 -6
- akshare/qhkc_web/qhkc_fund.py +10 -6
- akshare/qhkc_web/qhkc_index.py +28 -14
- akshare/qhkc_web/qhkc_tool.py +62 -59
- akshare/rate/__init__.py +1 -1
- akshare/rate/repo_rate.py +36 -32
- akshare/reits/__init__.py +1 -1
- akshare/reits/reits_basic.py +149 -13
- akshare/request.py +117 -0
- akshare/spot/__init__.py +1 -1
- akshare/spot/spot_hog_soozhu.py +165 -3
- akshare/spot/spot_sge.py +70 -9
- akshare/stock/cons.py +60 -23
- akshare/stock/stock_allotment_cninfo.py +8 -8
- akshare/stock/stock_ask_bid_em.py +3 -78
- akshare/stock/stock_board_concept_em.py +160 -35
- akshare/stock/stock_board_industry_em.py +163 -70
- akshare/stock/stock_dividend_cninfo.py +31 -17
- akshare/stock/stock_dzjy_em.py +347 -260
- akshare/stock/stock_fund_em.py +72 -64
- akshare/stock/stock_fund_hold.py +1 -2
- akshare/stock/stock_gsrl_em.py +1 -0
- akshare/stock/stock_hk_comparison_em.py +175 -0
- akshare/stock/stock_hk_famous.py +4 -5
- akshare/stock/stock_hk_fhpx_ths.py +2 -1
- akshare/stock/stock_hk_hot_rank_em.py +1 -0
- akshare/stock/stock_hk_sina.py +84 -36
- akshare/stock/stock_hold_control_cninfo.py +82 -0
- akshare/stock/stock_hold_control_em.py +0 -2
- akshare/stock/stock_hot_rank_em.py +4 -1
- akshare/stock/stock_hot_search_baidu.py +32 -19
- akshare/stock/stock_hot_up_em.py +4 -1
- akshare/stock/stock_hsgt_em.py +155 -0
- akshare/stock/stock_industry.py +1 -0
- akshare/stock/stock_industry_cninfo.py +1 -2
- akshare/stock/stock_info.py +6 -4
- akshare/stock/stock_info_em.py +17 -11
- akshare/stock/stock_intraday_em.py +4 -78
- akshare/stock/stock_intraday_sina.py +2 -2
- akshare/stock/stock_news_cx.py +39 -0
- akshare/stock/stock_profile_cninfo.py +7 -7
- akshare/stock/stock_profile_em.py +302 -0
- akshare/stock/stock_rank_forecast.py +6 -5
- akshare/stock/stock_repurchase_em.py +7 -2
- akshare/stock/stock_share_changes_cninfo.py +7 -5
- akshare/stock/stock_share_hold.py +24 -20
- akshare/stock/stock_stop.py +6 -6
- akshare/stock/stock_summary.py +153 -417
- akshare/stock/stock_us_famous.py +5 -6
- akshare/stock/stock_us_js.py +3 -2
- akshare/stock/stock_us_pink.py +38 -27
- akshare/stock/stock_us_sina.py +7 -3
- akshare/stock/stock_weibo_nlp.py +18 -20
- akshare/stock/stock_xq.py +24 -22
- akshare/stock/stock_zh_a_sina.py +8 -5
- akshare/stock/stock_zh_a_special.py +240 -243
- akshare/stock/stock_zh_a_tick_tx.py +11 -3
- akshare/stock/stock_zh_ah_tx.py +23 -26
- akshare/stock/stock_zh_b_sina.py +2 -2
- akshare/stock/stock_zh_comparison_em.py +250 -0
- akshare/stock/stock_zh_kcb_sina.py +67 -64
- akshare/stock_a/__init__.py +0 -0
- akshare/stock_a/stock_board_concept_name_em.py +170 -0
- akshare/stock_a/stock_individual_fund_flow_rank.py +258 -0
- akshare/stock_a/stock_zh_a_spot.py +212 -0
- akshare/stock_feature/cons.py +1 -0
- akshare/stock_feature/stock_a_indicator.py +9 -54
- akshare/stock_feature/stock_a_pe_and_pb.py +23 -5
- akshare/stock_feature/stock_account_em.py +0 -1
- akshare/stock_feature/stock_all_pb.py +2 -1
- akshare/stock_feature/stock_analyst_em.py +36 -30
- akshare/stock_feature/stock_board_concept_ths.py +328 -0
- akshare/stock_feature/stock_board_industry_ths.py +57 -2
- akshare/stock_feature/stock_buffett_index_lg.py +10 -8
- akshare/stock_feature/stock_classify_sina.py +3 -6
- akshare/stock_feature/stock_comment_em.py +81 -144
- akshare/stock_feature/stock_congestion_lg.py +2 -1
- akshare/stock_feature/stock_cyq_em.py +5 -11
- akshare/stock_feature/stock_disclosure_cninfo.py +6 -6
- akshare/stock_feature/stock_dxsyl_em.py +121 -74
- akshare/stock_feature/stock_ebs_lg.py +5 -4
- akshare/stock_feature/stock_esg_sina.py +29 -7
- akshare/stock_feature/stock_fhps_em.py +2 -1
- akshare/stock_feature/stock_fhps_ths.py +15 -7
- akshare/stock_feature/stock_fund_flow.py +30 -22
- akshare/stock_feature/stock_gddh_em.py +19 -11
- akshare/stock_feature/stock_gdfx_em.py +226 -113
- akshare/stock_feature/stock_gdhs.py +75 -50
- akshare/stock_feature/stock_gdzjc_em.py +21 -10
- akshare/stock_feature/stock_gpzy_em.py +78 -46
- akshare/stock_feature/stock_gxl_lg.py +3 -2
- akshare/stock_feature/stock_hist_em.py +137 -234
- akshare/stock_feature/stock_hist_tx.py +13 -10
- akshare/stock_feature/stock_hk_valuation_baidu.py +20 -8
- akshare/stock_feature/stock_hot_xq.py +4 -6
- akshare/stock_feature/stock_hsgt_em.py +269 -97
- akshare/stock_feature/stock_hsgt_exchange_rate.py +115 -87
- akshare/stock_feature/stock_hsgt_min_em.py +13 -16
- akshare/stock_feature/stock_info.py +7 -80
- akshare/stock_feature/stock_inner_trade_xq.py +38 -31
- akshare/stock_feature/stock_jgdy_em.py +43 -40
- akshare/stock_feature/stock_lhb_em.py +119 -3
- akshare/stock_feature/stock_margin_em.py +0 -1
- akshare/stock_feature/stock_margin_sse.py +0 -2
- akshare/stock_feature/stock_pankou_em.py +71 -35
- akshare/stock_feature/stock_qsjy_em.py +13 -4
- akshare/stock_feature/stock_report_em.py +151 -7
- akshare/stock_feature/stock_research_report_em.py +55 -20
- akshare/stock_feature/stock_sy_em.py +20 -15
- akshare/stock_feature/stock_technology_ths.py +122 -77
- akshare/stock_feature/stock_tfp_em.py +2 -1
- akshare/stock_feature/stock_three_report_em.py +21 -5
- akshare/stock_feature/stock_ttm_lyr.py +18 -9
- akshare/stock_feature/stock_value_em.py +83 -0
- akshare/stock_feature/stock_yjbb_em.py +58 -32
- akshare/stock_feature/stock_yjyg_cninfo.py +6 -2
- akshare/stock_feature/stock_yjyg_em.py +1 -1
- akshare/stock_feature/stock_yzxdr_em.py +24 -22
- akshare/stock_feature/stock_zdhtmx_em.py +20 -6
- akshare/stock_feature/stock_zh_vote_baidu.py +4 -1
- akshare/stock_feature/stock_ztb_em.py +39 -24
- akshare/stock_fundamental/__init__.py +1 -1
- akshare/stock_fundamental/stock_basic_info_xq.py +119 -0
- akshare/stock_fundamental/{stock_finance_hk.py → stock_finance_hk_em.py} +23 -16
- akshare/stock_fundamental/{stock_finance.py → stock_finance_sina.py} +60 -7
- akshare/stock_fundamental/stock_finance_ths.py +524 -57
- akshare/stock_fundamental/stock_finance_us_em.py +268 -0
- akshare/stock_fundamental/stock_gbjg_em.py +80 -0
- akshare/stock_fundamental/stock_hold.py +26 -17
- akshare/stock_fundamental/stock_ipo_declare.py +1 -0
- akshare/stock_fundamental/stock_kcb_detail_sse.py +10 -10
- akshare/stock_fundamental/stock_kcb_sse.py +26 -25
- akshare/stock_fundamental/stock_notice.py +12 -3
- akshare/stock_fundamental/stock_profit_forecast_em.py +31 -13
- akshare/stock_fundamental/stock_profit_forecast_hk_etnet.py +64 -41
- akshare/stock_fundamental/stock_profit_forecast_ths.py +86 -35
- akshare/stock_fundamental/stock_recommend.py +20 -4
- akshare/stock_fundamental/stock_zygc.py +5 -62
- akshare/utils/context.py +43 -0
- akshare/utils/demjson.py +2009 -1338
- akshare/utils/func.py +49 -2
- akshare/utils/multi_decrypt.py +53 -0
- akshare/utils/token_process.py +6 -5
- {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info}/METADATA +54 -80
- akshare-1.17.99.dist-info/RECORD +409 -0
- {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info}/WHEEL +1 -1
- {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info/licenses}/LICENSE +1 -1
- tests/test_func.py +3 -5
- akshare/bond/bond_futures.py +0 -50
- akshare/bond/bond_investing.py +0 -139
- akshare/crypto/crypto_hist_investing.py +0 -249
- akshare/fund/fund_announcement.py +0 -56
- akshare/futures/futures_international.py +0 -170
- akshare/futures/futures_news_baidu.py +0 -54
- akshare/futures/inventory_data.py +0 -100
- akshare/futures_derivative/futures_index_price_nh.py +0 -61
- akshare/futures_derivative/futures_index_return_nh.py +0 -47
- akshare/futures_derivative/futures_index_volatility_nh.py +0 -53
- akshare/futures_derivative/futures_other_index_nh.py +0 -145
- akshare/index/index_fear_greed_funddb.py +0 -78
- akshare/index/index_investing.py +0 -232
- akshare/sport/__init__.py +0 -6
- akshare/sport/sport_olympic.py +0 -27
- akshare/stock_feature/stock_wencai.py +0 -104
- akshare/stock_fundamental/stock_mda_ym.py +0 -40
- akshare-1.14.49.dist-info/RECORD +0 -387
- {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info}/top_level.txt +0 -0
akshare/qdii/qdii_jsl.py
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding:utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
Date: 2024/10/6 17:00
|
|
5
|
+
Desc: 集思录-T+0 QDII
|
|
6
|
+
集思录:https://www.jisilu.cn/data/qdii/#qdiie
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import pandas as pd
|
|
10
|
+
|
|
11
|
+
from akshare.request import make_request_with_retry_json
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def qdii_e_index_jsl() -> pd.DataFrame:
|
|
15
|
+
"""
|
|
16
|
+
集思录-T+0 QDII-欧美市场-欧美指数
|
|
17
|
+
https://www.jisilu.cn/data/qdii/#qdiia
|
|
18
|
+
:return: T+0 QDII-亚洲市场
|
|
19
|
+
:rtype: pandas.DataFrame
|
|
20
|
+
"""
|
|
21
|
+
url = "https://www.jisilu.cn/data/qdii/qdii_list/E"
|
|
22
|
+
params = {
|
|
23
|
+
"___jsl": "LST___t=1728207798534",
|
|
24
|
+
"rp": "22",
|
|
25
|
+
}
|
|
26
|
+
data_json = make_request_with_retry_json(url, params)
|
|
27
|
+
temp_df = pd.DataFrame([item["cell"] for item in data_json["rows"]])
|
|
28
|
+
temp_df.rename(
|
|
29
|
+
columns={
|
|
30
|
+
"fund_id": "代码",
|
|
31
|
+
"fund_nm": "名称",
|
|
32
|
+
"price": "现价",
|
|
33
|
+
"increase_rt": "涨幅",
|
|
34
|
+
"volume": "成交",
|
|
35
|
+
"amount": "场内份额",
|
|
36
|
+
"amount_incr": "场内新增",
|
|
37
|
+
"fund_nav": "T-2净值",
|
|
38
|
+
"nav_dt": "净值日期",
|
|
39
|
+
"estimate_value": "T-1估值",
|
|
40
|
+
"last_est_dt": "估值日期",
|
|
41
|
+
"discount_rt": "T-1溢价率",
|
|
42
|
+
"index_nm": "相关标的",
|
|
43
|
+
"ref_increase_rt": "T-1指数涨幅",
|
|
44
|
+
"apply_fee": "申购费",
|
|
45
|
+
"redeem_fee": "赎回费",
|
|
46
|
+
"mt_fee": "托管费",
|
|
47
|
+
"issuer_nm": "基金公司",
|
|
48
|
+
},
|
|
49
|
+
inplace=True,
|
|
50
|
+
)
|
|
51
|
+
temp_df = temp_df[
|
|
52
|
+
[
|
|
53
|
+
"代码",
|
|
54
|
+
"名称",
|
|
55
|
+
"现价",
|
|
56
|
+
"涨幅",
|
|
57
|
+
"成交",
|
|
58
|
+
"场内份额",
|
|
59
|
+
"场内新增",
|
|
60
|
+
"T-2净值",
|
|
61
|
+
"净值日期",
|
|
62
|
+
"T-1估值",
|
|
63
|
+
"估值日期",
|
|
64
|
+
"T-1溢价率",
|
|
65
|
+
"相关标的",
|
|
66
|
+
"T-1指数涨幅",
|
|
67
|
+
"申购费",
|
|
68
|
+
"赎回费",
|
|
69
|
+
"托管费",
|
|
70
|
+
"基金公司",
|
|
71
|
+
]
|
|
72
|
+
]
|
|
73
|
+
temp_df["净值日期"] = pd.to_datetime(temp_df["净值日期"], errors="coerce").dt.date
|
|
74
|
+
temp_df["估值日期"] = pd.to_datetime(temp_df["估值日期"], errors="coerce").dt.date
|
|
75
|
+
temp_df["现价"] = pd.to_numeric(temp_df["现价"], errors="coerce")
|
|
76
|
+
temp_df["成交"] = pd.to_numeric(temp_df["成交"], errors="coerce")
|
|
77
|
+
temp_df["场内份额"] = pd.to_numeric(temp_df["场内份额"], errors="coerce")
|
|
78
|
+
temp_df["场内新增"] = pd.to_numeric(temp_df["场内新增"], errors="coerce")
|
|
79
|
+
temp_df["T-2净值"] = pd.to_numeric(temp_df["T-2净值"], errors="coerce")
|
|
80
|
+
temp_df["T-1估值"] = pd.to_numeric(temp_df["T-1估值"], errors="coerce")
|
|
81
|
+
temp_df["托管费"] = pd.to_numeric(temp_df["托管费"], errors="coerce")
|
|
82
|
+
return temp_df
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def qdii_e_comm_jsl() -> pd.DataFrame:
|
|
86
|
+
"""
|
|
87
|
+
集思录-T+0 QDII-欧美市场-商品
|
|
88
|
+
https://www.jisilu.cn/data/qdii/#qdiia
|
|
89
|
+
:return: T+0 QDII-欧美市场-商品
|
|
90
|
+
:rtype: pandas.DataFrame
|
|
91
|
+
"""
|
|
92
|
+
url = "https://www.jisilu.cn/data/qdii/qdii_list/C"
|
|
93
|
+
params = {
|
|
94
|
+
"___jsl": "LST___t=1728207798534",
|
|
95
|
+
"rp": "22",
|
|
96
|
+
}
|
|
97
|
+
data_json = make_request_with_retry_json(url, params=params)
|
|
98
|
+
temp_df = pd.DataFrame([item["cell"] for item in data_json["rows"]])
|
|
99
|
+
temp_df.rename(
|
|
100
|
+
columns={
|
|
101
|
+
"fund_id": "代码",
|
|
102
|
+
"fund_nm": "名称",
|
|
103
|
+
"price": "现价",
|
|
104
|
+
"increase_rt": "涨幅",
|
|
105
|
+
"volume": "成交",
|
|
106
|
+
"amount": "场内份额",
|
|
107
|
+
"amount_incr": "场内新增",
|
|
108
|
+
"fund_nav": "T-2净值",
|
|
109
|
+
"nav_dt": "净值日期",
|
|
110
|
+
"estimate_value": "T-1估值",
|
|
111
|
+
"last_est_dt": "估值日期",
|
|
112
|
+
"discount_rt": "T-1溢价率",
|
|
113
|
+
"index_nm": "相关标的",
|
|
114
|
+
"ref_increase_rt": "T-1指数涨幅",
|
|
115
|
+
"apply_fee": "申购费",
|
|
116
|
+
"redeem_fee": "赎回费",
|
|
117
|
+
"mt_fee": "托管费",
|
|
118
|
+
"issuer_nm": "基金公司",
|
|
119
|
+
},
|
|
120
|
+
inplace=True,
|
|
121
|
+
)
|
|
122
|
+
temp_df = temp_df[
|
|
123
|
+
[
|
|
124
|
+
"代码",
|
|
125
|
+
"名称",
|
|
126
|
+
"现价",
|
|
127
|
+
"涨幅",
|
|
128
|
+
"成交",
|
|
129
|
+
"场内份额",
|
|
130
|
+
"场内新增",
|
|
131
|
+
"T-2净值",
|
|
132
|
+
"净值日期",
|
|
133
|
+
"T-1估值",
|
|
134
|
+
"估值日期",
|
|
135
|
+
"T-1溢价率",
|
|
136
|
+
"相关标的",
|
|
137
|
+
"T-1指数涨幅",
|
|
138
|
+
"申购费",
|
|
139
|
+
"赎回费",
|
|
140
|
+
"托管费",
|
|
141
|
+
"基金公司",
|
|
142
|
+
]
|
|
143
|
+
]
|
|
144
|
+
temp_df["净值日期"] = pd.to_datetime(temp_df["净值日期"], errors="coerce").dt.date
|
|
145
|
+
temp_df["估值日期"] = pd.to_datetime(temp_df["估值日期"], errors="coerce").dt.date
|
|
146
|
+
temp_df["现价"] = pd.to_numeric(temp_df["现价"], errors="coerce")
|
|
147
|
+
temp_df["成交"] = pd.to_numeric(temp_df["成交"], errors="coerce")
|
|
148
|
+
temp_df["场内份额"] = pd.to_numeric(temp_df["场内份额"], errors="coerce")
|
|
149
|
+
temp_df["场内新增"] = pd.to_numeric(temp_df["场内新增"], errors="coerce")
|
|
150
|
+
temp_df["T-2净值"] = pd.to_numeric(temp_df["T-2净值"], errors="coerce")
|
|
151
|
+
temp_df["T-1估值"] = pd.to_numeric(temp_df["T-1估值"], errors="coerce")
|
|
152
|
+
temp_df["托管费"] = pd.to_numeric(temp_df["托管费"], errors="coerce")
|
|
153
|
+
return temp_df
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def qdii_a_index_jsl() -> pd.DataFrame:
|
|
157
|
+
"""
|
|
158
|
+
集思录-T+0 QDII-亚洲市场-亚洲指数
|
|
159
|
+
https://www.jisilu.cn/data/qdii/#qdiia
|
|
160
|
+
:return: T+0 QDII-亚洲市场-亚洲指数
|
|
161
|
+
:rtype: pandas.DataFrame
|
|
162
|
+
"""
|
|
163
|
+
url = "https://www.jisilu.cn/data/qdii/qdii_list/A"
|
|
164
|
+
params = {
|
|
165
|
+
"___jsl": "LST___t=1728206439242",
|
|
166
|
+
"rp": "22",
|
|
167
|
+
}
|
|
168
|
+
data_json = make_request_with_retry_json(url, params=params)
|
|
169
|
+
temp_df = pd.DataFrame([item["cell"] for item in data_json["rows"]])
|
|
170
|
+
temp_df.rename(
|
|
171
|
+
columns={
|
|
172
|
+
"fund_id": "代码",
|
|
173
|
+
"fund_nm": "名称",
|
|
174
|
+
"price": "现价",
|
|
175
|
+
"increase_rt": "涨幅",
|
|
176
|
+
"volume": "成交",
|
|
177
|
+
"amount": "场内份额",
|
|
178
|
+
"amount_incr": "场内新增",
|
|
179
|
+
"fund_nav": "净值",
|
|
180
|
+
"nav_dt": "净值日期",
|
|
181
|
+
"estimate_value": "估值",
|
|
182
|
+
"discount_rt": "溢价率",
|
|
183
|
+
"index_nm": "相关标的",
|
|
184
|
+
"ref_increase_rt": "指数涨幅",
|
|
185
|
+
"apply_fee": "申购费",
|
|
186
|
+
"redeem_fee": "赎回费",
|
|
187
|
+
"mt_fee": "托管费",
|
|
188
|
+
"issuer_nm": "基金公司",
|
|
189
|
+
},
|
|
190
|
+
inplace=True,
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
temp_df = temp_df[
|
|
194
|
+
[
|
|
195
|
+
"代码",
|
|
196
|
+
"名称",
|
|
197
|
+
"现价",
|
|
198
|
+
"涨幅",
|
|
199
|
+
"成交",
|
|
200
|
+
"场内份额",
|
|
201
|
+
"场内新增",
|
|
202
|
+
"净值",
|
|
203
|
+
"净值日期",
|
|
204
|
+
"估值",
|
|
205
|
+
"溢价率",
|
|
206
|
+
"相关标的",
|
|
207
|
+
"指数涨幅",
|
|
208
|
+
"申购费",
|
|
209
|
+
"赎回费",
|
|
210
|
+
"托管费",
|
|
211
|
+
"基金公司",
|
|
212
|
+
]
|
|
213
|
+
]
|
|
214
|
+
temp_df["净值日期"] = pd.to_datetime(temp_df["净值日期"], errors="coerce").dt.date
|
|
215
|
+
temp_df["现价"] = pd.to_numeric(temp_df["现价"], errors="coerce")
|
|
216
|
+
temp_df["成交"] = pd.to_numeric(temp_df["成交"], errors="coerce")
|
|
217
|
+
temp_df["场内份额"] = pd.to_numeric(temp_df["场内份额"], errors="coerce")
|
|
218
|
+
temp_df["场内新增"] = pd.to_numeric(temp_df["场内新增"], errors="coerce")
|
|
219
|
+
temp_df["净值"] = pd.to_numeric(temp_df["净值"], errors="coerce")
|
|
220
|
+
temp_df["估值"] = pd.to_numeric(temp_df["估值"], errors="coerce")
|
|
221
|
+
temp_df["托管费"] = pd.to_numeric(temp_df["托管费"], errors="coerce")
|
|
222
|
+
return temp_df
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
if __name__ == "__main__":
|
|
226
|
+
qdii_e_index_jsl_df = qdii_e_index_jsl()
|
|
227
|
+
print(qdii_e_index_jsl_df)
|
|
228
|
+
|
|
229
|
+
qdii_e_comm_jsl_df = qdii_e_comm_jsl()
|
|
230
|
+
print(qdii_e_comm_jsl_df)
|
|
231
|
+
|
|
232
|
+
qdii_a_index_jsl_df = qdii_a_index_jsl()
|
|
233
|
+
print(qdii_a_index_jsl_df)
|
akshare/qhkc/__init__.py
CHANGED
akshare/qhkc/qhkc_api.py
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date:
|
|
4
|
+
Date: 2025/4/10 18:00
|
|
5
5
|
Desc: 接口测试文件
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
from akshare.pro.data_pro import pro_api
|
|
8
9
|
|
|
9
10
|
pro = pro_api()
|
|
10
11
|
|
|
11
12
|
# 商品-持仓数据-多头龙虎榜
|
|
12
|
-
variety_positions_longs_df = pro.variety_positions(
|
|
13
|
+
variety_positions_longs_df = pro.variety_positions(
|
|
14
|
+
fields="longs", code="rb1810", date="2018-08-08"
|
|
15
|
+
)
|
|
13
16
|
print(variety_positions_longs_df)
|
|
14
17
|
|
|
15
18
|
# 商品-持仓数据-空头龙虎榜
|
|
16
|
-
variety_positions_shorts_df = pro.variety_positions(
|
|
19
|
+
variety_positions_shorts_df = pro.variety_positions(
|
|
20
|
+
fields="shorts", code="rb1810", date="2018-08-08"
|
|
21
|
+
)
|
|
17
22
|
print(variety_positions_shorts_df)
|
|
18
23
|
|
|
19
24
|
# 商品-合约行情数据
|
|
@@ -41,7 +46,9 @@ variety_total_money_df = pro.variety_total_money(code="rb1810", date="2018-08-08
|
|
|
41
46
|
print(variety_total_money_df)
|
|
42
47
|
|
|
43
48
|
# 商品-商品的席位盈亏数据
|
|
44
|
-
variety_profit_df = pro.variety_profit(
|
|
49
|
+
variety_profit_df = pro.variety_profit(
|
|
50
|
+
symbol="RB", start_date="2018-02-08", end_date="2018-08-08"
|
|
51
|
+
)
|
|
45
52
|
print(variety_profit_df)
|
|
46
53
|
|
|
47
54
|
# 商品-自研指标数据
|
|
@@ -57,11 +64,15 @@ variety_longhu_short_top_df = pro.variety_longhu_top(fields="short", date="2018-
|
|
|
57
64
|
print(variety_longhu_short_top_df)
|
|
58
65
|
|
|
59
66
|
# 商品-牛熊线排行数据-多头排行
|
|
60
|
-
variety_niuxiong_long_top_df = pro.variety_niuxiong_top(
|
|
67
|
+
variety_niuxiong_long_top_df = pro.variety_niuxiong_top(
|
|
68
|
+
fields="long", date="2018-08-08"
|
|
69
|
+
)
|
|
61
70
|
print(variety_niuxiong_long_top_df)
|
|
62
71
|
|
|
63
72
|
# 商品-牛熊线排行数据-空头排行
|
|
64
|
-
variety_niuxiong_short_top_df = pro.variety_niuxiong_top(
|
|
73
|
+
variety_niuxiong_short_top_df = pro.variety_niuxiong_top(
|
|
74
|
+
fields="short", date="2018-08-08"
|
|
75
|
+
)
|
|
65
76
|
print(variety_niuxiong_short_top_df)
|
|
66
77
|
|
|
67
78
|
# 商品-商品相关研报数据
|
|
@@ -74,7 +85,9 @@ print(variety_all_df)
|
|
|
74
85
|
|
|
75
86
|
|
|
76
87
|
# 席位-商品净持仓数据
|
|
77
|
-
variety_net_positions_df = pro.variety_net_positions(
|
|
88
|
+
variety_net_positions_df = pro.variety_net_positions(
|
|
89
|
+
symbol="RB", broker="永安期货", date="2018-08-08"
|
|
90
|
+
)
|
|
78
91
|
print(variety_net_positions_df)
|
|
79
92
|
|
|
80
93
|
# 席位-席位持仓数据
|
|
@@ -82,7 +95,9 @@ broker_positions_df = pro.broker_positions(broker="永安期货", date="2018-08-
|
|
|
82
95
|
print(broker_positions_df)
|
|
83
96
|
|
|
84
97
|
# 席位-席位盈亏数据
|
|
85
|
-
broker_calendar_df = pro.broker_calendar(
|
|
98
|
+
broker_calendar_df = pro.broker_calendar(
|
|
99
|
+
broker="永安期货", start_date="2018-07-08", end_date="2018-08-08"
|
|
100
|
+
)
|
|
86
101
|
print(broker_calendar_df)
|
|
87
102
|
|
|
88
103
|
# 席位-席位每日大资金流动数据
|
|
@@ -94,7 +109,9 @@ broker_bbr_df = pro.broker_bbr(broker="永安期货", date="2018-08-08")
|
|
|
94
109
|
print(broker_bbr_df)
|
|
95
110
|
|
|
96
111
|
# 席位-席位净持仓保证金变化数据
|
|
97
|
-
broker_net_money_chge_df = pro.broker_net_money_chge(
|
|
112
|
+
broker_net_money_chge_df = pro.broker_net_money_chge(
|
|
113
|
+
broker="永安期货", date="2018-08-08"
|
|
114
|
+
)
|
|
98
115
|
print(broker_net_money_chge_df)
|
|
99
116
|
|
|
100
117
|
# 席位-席位净持仓保证金数据
|
|
@@ -106,15 +123,21 @@ broker_total_money_df = pro.broker_total_money(broker="永安期货", date="2018
|
|
|
106
123
|
print(broker_total_money_df)
|
|
107
124
|
|
|
108
125
|
# 席位-席位的商品盈亏数据
|
|
109
|
-
broker_profit_df = pro.broker_profit(
|
|
126
|
+
broker_profit_df = pro.broker_profit(
|
|
127
|
+
broker="永安期货", start_date="2018-07-08", end_date="2018-08-08"
|
|
128
|
+
)
|
|
110
129
|
print(broker_profit_df)
|
|
111
130
|
|
|
112
131
|
# 席位-席位盈利排行
|
|
113
|
-
broker_in_profit_list_df = pro.broker_in_profit_list(
|
|
132
|
+
broker_in_profit_list_df = pro.broker_in_profit_list(
|
|
133
|
+
start_date="2018-07-08", end_date="2018-08-08", count="10"
|
|
134
|
+
)
|
|
114
135
|
print(broker_in_profit_list_df)
|
|
115
136
|
|
|
116
137
|
# 席位-席位亏损排行
|
|
117
|
-
broker_in_loss_list_df = pro.broker_in_loss_list(
|
|
138
|
+
broker_in_loss_list_df = pro.broker_in_loss_list(
|
|
139
|
+
start_date="2018-07-08", end_date="2018-08-08", count="10"
|
|
140
|
+
)
|
|
118
141
|
print(broker_in_loss_list_df)
|
|
119
142
|
|
|
120
143
|
# 席位-所有席位数据
|
|
@@ -122,7 +145,9 @@ broker_all_df = pro.broker_all(offset_days="365")
|
|
|
122
145
|
print(broker_all_df)
|
|
123
146
|
|
|
124
147
|
# 席位-建仓过程
|
|
125
|
-
broker_positions_process_df = pro.broker_positions_process(
|
|
148
|
+
broker_positions_process_df = pro.broker_positions_process(
|
|
149
|
+
broker="永安期货", code="rb2010", start_date="2020-02-03", end_date="2020-06-03"
|
|
150
|
+
)
|
|
126
151
|
print(broker_positions_process_df)
|
|
127
152
|
|
|
128
153
|
# 席位-席位对对碰
|
|
@@ -135,15 +160,21 @@ index_info_df = pro.index_info(index_id="index0070c0eb-93ba-2da9-6633-fa70cb90e9
|
|
|
135
160
|
print(index_info_df)
|
|
136
161
|
|
|
137
162
|
# 指数-指数权重数据
|
|
138
|
-
index_weights_df = pro.index_weights(
|
|
163
|
+
index_weights_df = pro.index_weights(
|
|
164
|
+
index_id="index0070c0eb-93ba-2da9-6633-fa70cb90e959", date="2018-08-08"
|
|
165
|
+
)
|
|
139
166
|
print(index_weights_df)
|
|
140
167
|
|
|
141
168
|
# 指数-指数行情数据
|
|
142
|
-
index_quotes_df = pro.index_quotes(
|
|
169
|
+
index_quotes_df = pro.index_quotes(
|
|
170
|
+
index_id="index0070c0eb-93ba-2da9-6633-fa70cb90e959", date="2018-08-08"
|
|
171
|
+
)
|
|
143
172
|
print(index_quotes_df)
|
|
144
173
|
|
|
145
174
|
# 指数-指数沉淀资金数据
|
|
146
|
-
index_money_df = pro.index_money(
|
|
175
|
+
index_money_df = pro.index_money(
|
|
176
|
+
index_id="index0070c0eb-93ba-2da9-6633-fa70cb90e959", date="2018-08-08"
|
|
177
|
+
)
|
|
147
178
|
print(index_money_df)
|
|
148
179
|
|
|
149
180
|
# 指数-公共指数列表
|
|
@@ -155,11 +186,17 @@ index_mine_df = pro.index_mine()
|
|
|
155
186
|
print(index_mine_df)
|
|
156
187
|
|
|
157
188
|
# 指数-指数资金动向
|
|
158
|
-
index_trend_df = pro.index_trend(
|
|
189
|
+
index_trend_df = pro.index_trend(
|
|
190
|
+
index_id="index0070c0eb-93ba-2da9-6633-fa70cb90e959", date="2018-08-08"
|
|
191
|
+
)
|
|
159
192
|
print(index_trend_df)
|
|
160
193
|
|
|
161
194
|
# 指数-指数的席位盈亏数据
|
|
162
|
-
index_profit_df = pro.index_profit(
|
|
195
|
+
index_profit_df = pro.index_profit(
|
|
196
|
+
index_id="index0070c0eb-93ba-2da9-6633-fa70cb90e959",
|
|
197
|
+
start_date="2018-07-08",
|
|
198
|
+
end_date="2018-08-08",
|
|
199
|
+
)
|
|
163
200
|
print(index_profit_df)
|
|
164
201
|
|
|
165
202
|
# 基本面-基差
|
|
@@ -183,15 +220,21 @@ trader_prices_df = pro.trader_prices(variety="RB", date="2020-03-30")
|
|
|
183
220
|
print(trader_prices_df)
|
|
184
221
|
|
|
185
222
|
# 基本面-跨期套利数据
|
|
186
|
-
intertemporal_arbitrage_df = pro.intertemporal_arbitrage(
|
|
223
|
+
intertemporal_arbitrage_df = pro.intertemporal_arbitrage(
|
|
224
|
+
variety="RB", code1="01", code2="05", date="2018-08-08"
|
|
225
|
+
)
|
|
187
226
|
print(intertemporal_arbitrage_df)
|
|
188
227
|
|
|
189
228
|
# 基本面-自由价差数据
|
|
190
|
-
free_spread_df = pro.free_spread(
|
|
229
|
+
free_spread_df = pro.free_spread(
|
|
230
|
+
variety1="RB", code1="01", variety2="HC", code2="01", date="2018-08-08"
|
|
231
|
+
)
|
|
191
232
|
print(free_spread_df)
|
|
192
233
|
|
|
193
234
|
# 基本面-自由价比数据
|
|
194
|
-
free_ratio_df = pro.free_ratio(
|
|
235
|
+
free_ratio_df = pro.free_ratio(
|
|
236
|
+
variety1="RB", code1="01", variety2="HC", code2="01", date="2018-08-08"
|
|
237
|
+
)
|
|
195
238
|
print(free_ratio_df)
|
|
196
239
|
|
|
197
240
|
# 基本面-仓单数据
|
|
@@ -235,4 +278,3 @@ print(stock_flow_short_df)
|
|
|
235
278
|
# 资金-每日商品保证金沉淀变化
|
|
236
279
|
money_in_out_df = pro.money_in_out(date="2018-08-08")
|
|
237
280
|
print(money_in_out_df)
|
|
238
|
-
|
akshare/qhkc_web/__init__.py
CHANGED
akshare/qhkc_web/qhkc_fund.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date:
|
|
4
|
+
Date: 2025/4/10 18:00
|
|
5
5
|
Desc: 奇货可查网站目前已经商业化运营, 特提供奇货可查-资金数据接口, 方便您程序化调用
|
|
6
6
|
注:期货价格为收盘价; 现货价格来自网络; 基差=现货价格-期货价格; 基差率=(现货价格-期货价格)/现货价格 * 100 %.
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import datetime
|
|
9
10
|
from typing import AnyStr
|
|
10
11
|
|
|
@@ -27,7 +28,8 @@ def get_qhkc_fund_bs(
|
|
|
27
28
|
可获取数据的时间段为:"2016-10-10:2019-09-30"
|
|
28
29
|
:param url: 网址
|
|
29
30
|
:param date: 中文名称
|
|
30
|
-
:return:
|
|
31
|
+
:return: 净持仓分布
|
|
32
|
+
:rtype: pandas.DataFrame
|
|
31
33
|
symbol_df
|
|
32
34
|
name value ratio date
|
|
33
35
|
IC 1552535406 0.195622 20190924
|
|
@@ -124,7 +126,8 @@ def get_qhkc_fund_position(
|
|
|
124
126
|
可获取数据的时间段为:"2016-10-10:2019-09-30"
|
|
125
127
|
:param url: 网址
|
|
126
128
|
:param date: 中文名称
|
|
127
|
-
:return:
|
|
129
|
+
:return: 总持仓分布
|
|
130
|
+
:rtype: pandas.DataFrame
|
|
128
131
|
symbol_df
|
|
129
132
|
name value ratio date
|
|
130
133
|
IC 1552535406 0.195622 20190924
|
|
@@ -321,7 +324,8 @@ def get_qhkc_fund_money_change(
|
|
|
321
324
|
可获取数据的时间段为:"2016-10-10:2019-09-30"
|
|
322
325
|
:param url: 网址
|
|
323
326
|
:param date: 中文名称
|
|
324
|
-
:return:
|
|
327
|
+
:return: 成交额分布
|
|
328
|
+
:rtype: pandas.DataFrame
|
|
325
329
|
name value ratio date
|
|
326
330
|
沪镍 2.292e+10 0.145963 2019-09-25
|
|
327
331
|
沪银 1.22788e+10 0.0781956 2019-09-25
|
|
@@ -417,5 +421,5 @@ if __name__ == "__main__":
|
|
|
417
421
|
# print(df1)
|
|
418
422
|
# print(df2)
|
|
419
423
|
|
|
420
|
-
|
|
421
|
-
print(
|
|
424
|
+
get_qhkc_fund_money_change_df = get_qhkc_fund_money_change(20211208)
|
|
425
|
+
print(get_qhkc_fund_money_change_df)
|
akshare/qhkc_web/qhkc_index.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date:
|
|
4
|
+
Date: 2025/4/10 18:00
|
|
5
5
|
Desc: 奇货可查网站目前已经商业化运营, 特提供奇货可查-指数数据接口, 方便您程序化调用
|
|
6
6
|
注:期货价格为收盘价; 现货价格来自网络; 基差=现货价格-期货价格; 基差率=(现货价格-期货价格)/现货价格 * 100 %.
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
from typing import AnyStr
|
|
9
10
|
|
|
10
11
|
import pandas as pd
|
|
@@ -22,8 +23,11 @@ def get_qhkc_index(name: AnyStr = "奇货商品", url: AnyStr = QHKC_INDEX_URL):
|
|
|
22
23
|
奇货可查-指数-指数详情
|
|
23
24
|
获得奇货可查的指数数据: '奇货黑链', '奇货商品', '奇货谷物', '奇货贵金属', '奇货饲料', '奇货软商品', '奇货化工', '奇货有色', '奇货股指', '奇货铁合金', '奇货油脂'
|
|
24
25
|
:param url: 网址
|
|
25
|
-
:
|
|
26
|
-
:
|
|
26
|
+
:type url: str
|
|
27
|
+
:param name: 中文名称
|
|
28
|
+
:type name: str
|
|
29
|
+
:return: 指数详情
|
|
30
|
+
:rtype: pandas.DataFrame
|
|
27
31
|
date price volume ... margin profit long_short_ratio
|
|
28
32
|
2013-01-04 1000 260820 ... 1130485758 1816940 52.78
|
|
29
33
|
2013-01-07 998.244 245112 ... 1132228518 2514410 52.15
|
|
@@ -74,9 +78,12 @@ def get_qhkc_index_trend(name: AnyStr = "奇货商品", url: AnyStr = QHKC_INDEX
|
|
|
74
78
|
"""
|
|
75
79
|
奇货可查-指数-大资金动向
|
|
76
80
|
获得奇货可查的指数数据: '奇货黑链', '奇货商品', '奇货谷物', '奇货贵金属', '奇货饲料', '奇货软商品', '奇货化工', '奇货有色', '奇货股指', '奇货铁合金', '奇货油脂'
|
|
81
|
+
:param name: None
|
|
82
|
+
:type name: str
|
|
77
83
|
:param url: 网址
|
|
78
|
-
:
|
|
79
|
-
:return:
|
|
84
|
+
:type url: str
|
|
85
|
+
:return: 大资金动向
|
|
86
|
+
:rtype: pandas.DataFrame
|
|
80
87
|
broker grade money open_order variety
|
|
81
88
|
中金期货 B -3.68209e+07 3.68209e+07 沪金
|
|
82
89
|
浙商期货 D -25845534 25845534 沪银
|
|
@@ -131,7 +138,7 @@ def get_qhkc_index_trend(name: AnyStr = "奇货商品", url: AnyStr = QHKC_INDEX
|
|
|
131
138
|
money = item["money"]
|
|
132
139
|
order_money = item["order_money"]
|
|
133
140
|
variety = item["variety"]
|
|
134
|
-
df_temp = df_temp.
|
|
141
|
+
df_temp = df_temp._append(
|
|
135
142
|
pd.DataFrame([broker, grade, money, order_money, variety]).T
|
|
136
143
|
)
|
|
137
144
|
df_temp.columns = ["broker", "grade", "money", "open_order", "variety"]
|
|
@@ -149,10 +156,15 @@ def get_qhkc_index_profit_loss(
|
|
|
149
156
|
奇货可查-指数-盈亏详情
|
|
150
157
|
获得奇货可查的指数数据: '奇货黑链', '奇货商品', '奇货谷物', '奇货贵金属', '奇货饲料', '奇货软商品', '奇货化工', '奇货有色', '奇货股指', '奇货铁合金', '奇货油脂'
|
|
151
158
|
:param url: 网址
|
|
152
|
-
:
|
|
159
|
+
:type url: str
|
|
160
|
+
:param name: None
|
|
161
|
+
:type name: str
|
|
153
162
|
:param start_date: ""
|
|
163
|
+
:type start_date: str
|
|
154
164
|
:param end_date: "20190716" 指定 end_date 就可以了
|
|
155
|
-
:
|
|
165
|
+
:type end_date: str
|
|
166
|
+
:return: 盈亏详情
|
|
167
|
+
:rtype: pandas.DataFrame
|
|
156
168
|
indexes value trans_date
|
|
157
169
|
招金期货-沪金 -307489200 2019-09-30
|
|
158
170
|
平安期货-沪银 -195016650 2019-09-30
|
|
@@ -186,9 +198,11 @@ def get_qhkc_index_profit_loss(
|
|
|
186
198
|
|
|
187
199
|
|
|
188
200
|
if __name__ == "__main__":
|
|
189
|
-
|
|
190
|
-
print(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
201
|
+
get_qhkc_index_df = get_qhkc_index("奇货谷物")
|
|
202
|
+
print(get_qhkc_index_df)
|
|
203
|
+
|
|
204
|
+
get_qhkc_index_trend_df = get_qhkc_index_trend("奇货贵金属")
|
|
205
|
+
print(get_qhkc_index_trend_df)
|
|
206
|
+
|
|
207
|
+
get_qhkc_index_profit_loss_df = get_qhkc_index_profit_loss("奇货贵金属", end_date="20250410")
|
|
208
|
+
print(get_qhkc_index_profit_loss_df)
|