finmind 2.0.2__tar.gz → 2.0.4__tar.gz
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.
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/data/data_loader.py +62 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/data/finmind_api.py +18 -16
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/schema/data.py +4 -0
- {finmind-2.0.2/finmind.egg-info → finmind-2.0.4}/PKG-INFO +1 -1
- {finmind-2.0.2 → finmind-2.0.4/finmind.egg-info}/PKG-INFO +1 -1
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/_version.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/crawler/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/crawler/base.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/crawler/commodities.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/crawler/demo.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/crawler/government_bonds.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/data/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/data/data_subscriber.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/bias.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/continue_holding.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/institutional_investors_follower.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/institutional_investors_over_buy.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/kd.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/kd_crossover.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/ma_cross_orver.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/indicators/short_sale_margin_purchase_ratio.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/plotting/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/plotting/bar.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/plotting/kline.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/plotting/line.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/plotting/pie.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/schema/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/schema/indicators.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/schema/info.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/schema/plot.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/schema/rule.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/base.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/bias.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/continue_holding.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/institutional_investors_follower.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/kd.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/kd_crossover.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/ma_crossover.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/macd_crossover.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/max_min_period_bias.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/naive_kd.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/short_sale_margin_purchase_ratio.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/strategies/utils.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/templates/post.html +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/utility/__init__.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/utility/request.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/FinMind/utility/rule.py +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/LICENSE +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/README.md +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/finmind.egg-info/SOURCES.txt +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/finmind.egg-info/dependency_links.txt +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/finmind.egg-info/requires.txt +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/finmind.egg-info/top_level.txt +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/pyproject.toml +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/setup.cfg +0 -0
- {finmind-2.0.2 → finmind-2.0.4}/setup.py +0 -0
|
@@ -2918,6 +2918,68 @@ class DataLoader(FinMindApi):
|
|
|
2918
2918
|
)
|
|
2919
2919
|
return taiwan_stock_day_trading_borrowing_fee_rate
|
|
2920
2920
|
|
|
2921
|
+
def taiwan_stock_convertible_bond_monthly_analysis(
|
|
2922
|
+
self,
|
|
2923
|
+
cb_id: str = "",
|
|
2924
|
+
start_date: str = "",
|
|
2925
|
+
end_date: str = "",
|
|
2926
|
+
timeout: int = None,
|
|
2927
|
+
) -> pd.DataFrame:
|
|
2928
|
+
"""get 可轉換公司債月份分析表
|
|
2929
|
+
:param cb_id (str): 可轉債代號("11011")
|
|
2930
|
+
:param start_date (str): 起始日期("2026-05-01")
|
|
2931
|
+
:param end_date (str): 結束日期("2026-05-02")
|
|
2932
|
+
:param timeout (int): timeout seconds, default None
|
|
2933
|
+
|
|
2934
|
+
:return: 可轉換公司債月份分析表 TaiwanStockConvertibleBondMonthlyAnalysis
|
|
2935
|
+
:rtype pd.DataFrame
|
|
2936
|
+
:rtype column cb_id (str): 可轉債代號
|
|
2937
|
+
:rtype column cb_name (str): 可轉債名稱
|
|
2938
|
+
:rtype column cb_name_en (str): 可轉債英文名稱
|
|
2939
|
+
:rtype column custody_balance (int): 保管餘額
|
|
2940
|
+
:rtype column last_month_balance (int): 上月餘額
|
|
2941
|
+
:rtype column change (int): 增減
|
|
2942
|
+
:rtype column change_percent (float): 增減百分比
|
|
2943
|
+
:rtype column issued_units (int): 發行單位數
|
|
2944
|
+
:rtype column custody_accounts (int): 保管戶數
|
|
2945
|
+
:rtype column pledged_units (int): 設質單位數
|
|
2946
|
+
:rtype column date (str): 日期
|
|
2947
|
+
"""
|
|
2948
|
+
taiwan_stock_convertible_bond_monthly_analysis = self.get_data(
|
|
2949
|
+
dataset=Dataset.TaiwanStockConvertibleBondMonthlyAnalysis,
|
|
2950
|
+
data_id=cb_id,
|
|
2951
|
+
start_date=start_date,
|
|
2952
|
+
end_date=end_date,
|
|
2953
|
+
timeout=timeout,
|
|
2954
|
+
)
|
|
2955
|
+
return taiwan_stock_convertible_bond_monthly_analysis
|
|
2956
|
+
|
|
2957
|
+
def taiwan_option_vix(
|
|
2958
|
+
self,
|
|
2959
|
+
start_date: str = "",
|
|
2960
|
+
end_date: str = "",
|
|
2961
|
+
timeout: int = None,
|
|
2962
|
+
) -> pd.DataFrame:
|
|
2963
|
+
"""get 臺指選擇權波動率指數
|
|
2964
|
+
:param start_date (str): 起始日期("2024-01-01")
|
|
2965
|
+
:param end_date (str): 結束日期("2024-12-31")
|
|
2966
|
+
:param timeout (int): timeout seconds, default None
|
|
2967
|
+
|
|
2968
|
+
:return: 臺指選擇權波動率指數 TaiwanOptionVix
|
|
2969
|
+
:rtype pd.DataFrame
|
|
2970
|
+
:rtype column date (str): 日期
|
|
2971
|
+
:rtype column time (str): 時間
|
|
2972
|
+
:rtype column vix (float): 波動率指數
|
|
2973
|
+
"""
|
|
2974
|
+
taiwan_option_vix = self.get_data(
|
|
2975
|
+
dataset=Dataset.TaiwanOptionVix,
|
|
2976
|
+
data_id="",
|
|
2977
|
+
start_date=start_date,
|
|
2978
|
+
end_date=end_date,
|
|
2979
|
+
timeout=timeout,
|
|
2980
|
+
)
|
|
2981
|
+
return taiwan_option_vix
|
|
2982
|
+
|
|
2921
2983
|
def _get_stock_id_list(
|
|
2922
2984
|
self, date: str, timeout: int = None
|
|
2923
2985
|
) -> typing.List[str]:
|
|
@@ -144,22 +144,24 @@ class FinMindApi:
|
|
|
144
144
|
:param params: finmind api參數
|
|
145
145
|
:return:
|
|
146
146
|
"""
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
147
|
+
# 只要傳入 id 列表就走非同步批次下載,不再依賴 use_async 旗標。
|
|
148
|
+
# 過去 use_async 預設 False 時 sync 分支會忽略 data_id_list、
|
|
149
|
+
# 只用空的 data_id 查詢,導致回傳空 DataFrame。
|
|
150
|
+
if securities_trader_id_list:
|
|
151
|
+
return self._get_data_with_async_with_securities_trader_id(
|
|
152
|
+
dataset=dataset,
|
|
153
|
+
securities_trader_id_list=securities_trader_id_list,
|
|
154
|
+
start_date=start_date,
|
|
155
|
+
end_date=end_date,
|
|
156
|
+
)
|
|
157
|
+
elif data_id_list:
|
|
158
|
+
return self._get_data_with_async(
|
|
159
|
+
dataset=dataset,
|
|
160
|
+
data_id_list=data_id_list,
|
|
161
|
+
start_date=start_date,
|
|
162
|
+
end_date=end_date,
|
|
163
|
+
max_retry_times=max_retry_times,
|
|
164
|
+
)
|
|
163
165
|
else:
|
|
164
166
|
logger.info(f"download {dataset}, data_id: {data_id}")
|
|
165
167
|
params = dict(
|
|
@@ -137,6 +137,10 @@ class Dataset(str, Enum):
|
|
|
137
137
|
TaiwanOptionFinalSettlementPrice = "TaiwanOptionFinalSettlementPrice"
|
|
138
138
|
TaiwanStockBlockTrade = "TaiwanStockBlockTrade"
|
|
139
139
|
TaiwanStockLoanCollateralBalance = "TaiwanStockLoanCollateralBalance"
|
|
140
|
+
TaiwanStockConvertibleBondMonthlyAnalysis = (
|
|
141
|
+
"TaiwanStockConvertibleBondMonthlyAnalysis"
|
|
142
|
+
)
|
|
143
|
+
TaiwanOptionVix = "TaiwanOptionVix"
|
|
140
144
|
|
|
141
145
|
|
|
142
146
|
class Version(str, Enum):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|