tooja 0.1.0__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.
- tooja/__init__.py +9 -0
- tooja/brokers/__init__.py +5 -0
- tooja/brokers/kis/__init__.py +7 -0
- tooja/brokers/kis/_call.py +143 -0
- tooja/brokers/kis/_mappers.py +955 -0
- tooja/brokers/kis/_rate_limit.py +16 -0
- tooja/brokers/kis/_ws_stream.py +416 -0
- tooja/brokers/kis/account.py +139 -0
- tooja/brokers/kis/analytics.py +175 -0
- tooja/brokers/kis/auth.py +215 -0
- tooja/brokers/kis/broker.py +151 -0
- tooja/brokers/kis/credentials.py +27 -0
- tooja/brokers/kis/info.py +179 -0
- tooja/brokers/kis/mapping.py +64 -0
- tooja/brokers/kis/market.py +248 -0
- tooja/brokers/kis/orders.py +344 -0
- tooja/brokers/kis/rankings.py +265 -0
- tooja/brokers/kis/raw/__init__.py +0 -0
- tooja/brokers/kis/raw/base.py +269 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/avg_unit.py +97 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/inquire_asking_price.py +67 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/inquire_ccnl.py +40 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/inquire_daily_itemchartprice.py +39 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/inquire_daily_price.py +42 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/inquire_price.py +50 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/issue_info.py +119 -0
- tooja/brokers/kis/raw/domestic_bond_quotations/search_bond_info.py +114 -0
- tooja/brokers/kis/raw/domestic_bond_trading/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_bond_trading/buy.py +45 -0
- tooja/brokers/kis/raw/domestic_bond_trading/inquire_balance.py +50 -0
- tooja/brokers/kis/raw/domestic_bond_trading/inquire_daily_ccld.py +71 -0
- tooja/brokers/kis/raw/domestic_bond_trading/inquire_psbl_order.py +43 -0
- tooja/brokers/kis/raw/domestic_bond_trading/inquire_psbl_rvsecncl.py +52 -0
- tooja/brokers/kis/raw/domestic_bond_trading/order_rvsecncl.py +45 -0
- tooja/brokers/kis/raw/domestic_bond_trading/sell.py +49 -0
- tooja/brokers/kis/raw/domestic_bond_ws/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_bond_ws/h0bicnt0.py +38 -0
- tooja/brokers/kis/raw/domestic_bond_ws/h0bjasp0.py +52 -0
- tooja/brokers/kis/raw/domestic_bond_ws/h0bjcnt0.py +37 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/display_board_callput.py +124 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/display_board_futures.py +54 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/display_board_option_list.py +36 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/display_board_top.py +53 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/exp_price_trend.py +49 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/inquire_asking_price.py +81 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/inquire_daily_fuopchartprice.py +71 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/inquire_price.py +89 -0
- tooja/brokers/kis/raw/domestic_futureoption_quotations/inquire_time_fuopchartprice.py +82 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_balance.py +92 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_balance_settlement_pl.py +65 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_balance_valuation_pl.py +87 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_ccnl.py +83 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_ccnl_bstime.py +57 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_daily_amount_fee.py +76 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_deposit.py +63 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_ngt_balance.py +94 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_ngt_ccnl.py +83 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_psbl_ngt_order.py +44 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/inquire_psbl_order.py +42 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/margin_rate.py +41 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/ngt_margin_detail.py +139 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/order.py +50 -0
- tooja/brokers/kis/raw/domestic_futureoption_trading/order_rvsecncl.py +51 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0cfasp0.py +55 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0cfcnt0.py +67 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0euanc0.py +26 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0euasp0.py +56 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0eucni0.py +37 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0eucnt0.py +74 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0ifasp0.py +55 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0ifcni0.py +39 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0ifcnt0.py +67 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0ioasp0.py +55 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0iocnt0.py +75 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0mfasp0.py +56 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0mfcni0.py +37 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0mfcnt0.py +67 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0zfanc0.py +26 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0zfasp0.py +85 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0zfcnt0.py +66 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0zoanc0.py +25 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0zoasp0.py +85 -0
- tooja/brokers/kis/raw/domestic_futureoption_ws/h0zocnt0.py +70 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/compare_stocks.py +35 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/cond_search.py +131 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/expiration_stocks.py +62 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/indicator.py +55 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/indicator_trend_ccnl.py +45 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/indicator_trend_daily.py +48 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/indicator_trend_minute.py +48 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/inquire_elw_price.py +71 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/lp_trade_trend.py +67 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/newly_listed.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/quick_change.py +59 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/sensitivity.py +59 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/sensitivity_trend_ccnl.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/sensitivity_trend_daily.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/udrl_asset_list.py +40 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/udrl_asset_price.py +76 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/updown_rate.py +80 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/volatility_trend_ccnl.py +42 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/volatility_trend_daily.py +48 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/volatility_trend_minute.py +43 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/volatility_trend_tick.py +37 -0
- tooja/brokers/kis/raw/domestic_stock_elw_quotations/volume_rank.py +88 -0
- tooja/brokers/kis/raw/domestic_stock_industry/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_industry/chk_holiday.py +40 -0
- tooja/brokers/kis/raw/domestic_stock_industry/comp_interest.py +54 -0
- tooja/brokers/kis/raw/domestic_stock_industry/exp_index_trend.py +42 -0
- tooja/brokers/kis/raw/domestic_stock_industry/exp_total_index.py +60 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_daily_indexchartprice.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_index_category_price.py +71 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_index_daily_price.py +73 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_index_price.py +69 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_index_tickprice.py +41 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_index_timeprice.py +42 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_time_indexchartprice.py +65 -0
- tooja/brokers/kis/raw/domestic_stock_industry/inquire_vi_status.py +52 -0
- tooja/brokers/kis/raw/domestic_stock_industry/market_time.py +41 -0
- tooja/brokers/kis/raw/domestic_stock_industry/news_title.py +51 -0
- tooja/brokers/kis/raw/domestic_stock_info/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_info/balance_sheet.py +45 -0
- tooja/brokers/kis/raw/domestic_stock_info/bonus_issue.py +46 -0
- tooja/brokers/kis/raw/domestic_stock_info/cap_dcrs.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_info/credit_by_company.py +39 -0
- tooja/brokers/kis/raw/domestic_stock_info/dividend.py +50 -0
- tooja/brokers/kis/raw/domestic_stock_info/estimate_perform.py +66 -0
- tooja/brokers/kis/raw/domestic_stock_info/financial_ratio.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_info/forfeit.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_info/growth_ratio.py +39 -0
- tooja/brokers/kis/raw/domestic_stock_info/income_statement.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_info/invest_opbysec.py +53 -0
- tooja/brokers/kis/raw/domestic_stock_info/invest_opinion.py +48 -0
- tooja/brokers/kis/raw/domestic_stock_info/lendable_by_company.py +58 -0
- tooja/brokers/kis/raw/domestic_stock_info/list_info.py +43 -0
- tooja/brokers/kis/raw/domestic_stock_info/mand_deposit.py +41 -0
- tooja/brokers/kis/raw/domestic_stock_info/merger_split.py +49 -0
- tooja/brokers/kis/raw/domestic_stock_info/other_major_ratios.py +39 -0
- tooja/brokers/kis/raw/domestic_stock_info/paidin_capin.py +49 -0
- tooja/brokers/kis/raw/domestic_stock_info/profit_ratio.py +39 -0
- tooja/brokers/kis/raw/domestic_stock_info/pub_offer.py +48 -0
- tooja/brokers/kis/raw/domestic_stock_info/purreq.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_info/rev_split.py +43 -0
- tooja/brokers/kis/raw/domestic_stock_info/search_info.py +51 -0
- tooja/brokers/kis/raw/domestic_stock_info/search_stock_info.py +100 -0
- tooja/brokers/kis/raw/domestic_stock_info/sharehld_meet.py +42 -0
- tooja/brokers/kis/raw/domestic_stock_info/stability_ratio.py +39 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/exp_closing_price.py +45 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_asking_price.py +132 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_asking_price_exp_ccn.py +122 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_ccnl.py +40 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_component_stock_price.py +70 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_daily_itemchartprice.py +85 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_daily_overtimeprice.py +66 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_daily_price.py +49 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_investor.py +55 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_member.py +100 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_overtime_asking_price.py +107 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_overtime_price.py +68 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_price.py +115 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_price_2.py +87 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_price_fhpst02400000.py +92 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_time_dailychartprice.py +58 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_time_itemchartprice.py +57 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_time_itemconclusion.py +56 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/inquire_time_overtimeconclusion.py +66 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/nav_comparison_daily_trend.py +48 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/nav_comparison_time_trend.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_quotations/nav_comparison_trend.py +58 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/capture_uplowprice.py +58 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/comp_program_trade_daily.py +135 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/comp_program_trade_today.py +55 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/daily_credit_balance.py +61 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/daily_loan_trans.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/daily_short_sale.py +65 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/exp_price_trend.py +53 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/foreign_institution_total.py +63 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/frgnmem_pchs_trend.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/frgnmem_trade_estimate.py +46 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/frgnmem_trade_trend.py +54 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/inquire_daily_trade_volume.py +46 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/inquire_investor_daily_by_market.py +76 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/inquire_investor_time_by_market.py +105 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/inquire_member_daily.py +46 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/intstock_grouplist.py +40 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/intstock_multprice.py +120 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/intstock_stocklist_by_group.py +56 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/investor_program_trade_today.py +53 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/investor_trade_by_stock_daily.py +149 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/investor_trend_estimate.py +36 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/mktfunds.py +49 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/overtime_exp_trans_fluct.py +52 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/pbar_tratio.py +55 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/program_trade_by_stock.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/program_trade_by_stock_daily.py +49 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/psearch_result.py +57 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/psearch_title.py +36 -0
- tooja/brokers/kis/raw/domestic_stock_quote_analysis/tradprt_byamt.py +45 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/after_hour_balance.py +52 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/bulk_trans_num.py +54 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/credit_balance.py +60 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/disparity.py +55 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/dividend_rate.py +46 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/exp_trans_updown.py +56 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/finance_ratio.py +71 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/fluctuation.py +69 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/hts_top_view.py +34 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/market_cap.py +51 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/market_value.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/near_new_highlow.py +59 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/overtime_fluctuation.py +73 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/overtime_volume.py +63 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/prefer_disparate_ratio.py +57 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/profit_asset_index.py +62 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/quote_balance.py +54 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/short_sale.py +56 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/top_interest_stock.py +55 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/traded_by_company.py +55 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/volume_power.py +51 -0
- tooja/brokers/kis/raw/domestic_stock_rank_analysis/volume_rank.py +60 -0
- tooja/brokers/kis/raw/domestic_stock_trading/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_account_balance.py +71 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_balance.py +100 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_balance_rlz_pl.py +99 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_balance_tttc2208r.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_credit_psamount.py +51 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_daily_ccld.py +95 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_daily_ccld_tttc2201r.py +59 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_deposit.py +38 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_period_profit.py +73 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_period_trade_profit.py +82 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_present_balance.py +61 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_psbl_order.py +51 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_psbl_order_tttc0503r.py +43 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_psbl_rvsecncl.py +58 -0
- tooja/brokers/kis/raw/domestic_stock_trading/inquire_psbl_sell.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_trading/intgr_margin.py +140 -0
- tooja/brokers/kis/raw/domestic_stock_trading/order_cash.py +56 -0
- tooja/brokers/kis/raw/domestic_stock_trading/order_credit.py +58 -0
- tooja/brokers/kis/raw/domestic_stock_trading/order_resv.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_trading/order_resv_ccnl.py +66 -0
- tooja/brokers/kis/raw/domestic_stock_trading/order_resv_rvsecncl.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_trading/order_rvsecncl.py +65 -0
- tooja/brokers/kis/raw/domestic_stock_trading/period_rights.py +72 -0
- tooja/brokers/kis/raw/domestic_stock_ws/__init__.py +0 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0ewanc0.py +77 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0ewasp0.py +91 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0ewcnt0.py +81 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0nxanc0.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0nxasp0.py +83 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0nxcnt0.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0nxmbc0.py +96 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0nxmko0.py +29 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0nxpgm0.py +29 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stanc0.py +63 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stasp0.py +77 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stcni0.py +44 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stcnt0.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stmbc0.py +95 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stmko0.py +28 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stnav0.py +26 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stoaa0.py +72 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stoac0.py +61 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stoup0.py +61 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0stpgm0.py +28 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0unanc0.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0unasp0.py +83 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0uncnt0.py +64 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0unmbc0.py +96 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0unmko0.py +28 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0unpgm0.py +29 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0upanc0.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0upcnt0.py +47 -0
- tooja/brokers/kis/raw/domestic_stock_ws/h0uppgm0.py +105 -0
- tooja/brokers/kis/raw/oauth/__init__.py +0 -0
- tooja/brokers/kis/raw/oauth/approval.py +29 -0
- tooja/brokers/kis/raw/oauth/revokep.py +30 -0
- tooja/brokers/kis/raw/oauth/tokenp.py +32 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/__init__.py +0 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/daily_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/inquire_asking_price.py +53 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/inquire_price.py +64 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/inquire_time_futurechartprice.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/inquire_time_optchartprice.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/investor_unpd_trend.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/market_time.py +52 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/monthly_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/opt_asking_price.py +53 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/opt_daily_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/opt_detail.py +53 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/opt_monthly_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/opt_price.py +63 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/opt_tick_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/opt_weekly_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/search_contract_detail.py +57 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/search_opt_detail.py +56 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/stock_detail.py +55 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/tick_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_quotations/weekly_ccnl.py +58 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/__init__.py +0 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_ccld.py +69 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_daily_ccld.py +67 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_daily_order.py +68 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_deposit.py +60 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_period_ccld.py +77 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_period_trans.py +57 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_psamount.py +47 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/inquire_unpd.py +51 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/margin_detail.py +84 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/order.py +49 -0
- tooja/brokers/kis/raw/overseas_futureoption_trading/order_rvsecncl.py +43 -0
- tooja/brokers/kis/raw/overseas_futureoption_ws/__init__.py +0 -0
- tooja/brokers/kis/raw/overseas_futureoption_ws/hdfff010.py +52 -0
- tooja/brokers/kis/raw/overseas_futureoption_ws/hdfff020.py +43 -0
- tooja/brokers/kis/raw/overseas_futureoption_ws/hdfff1c0.py +50 -0
- tooja/brokers/kis/raw/overseas_futureoption_ws/hdfff2c0.py +50 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/__init__.py +0 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/countries_holiday.py +42 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/dailyprice.py +60 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/industry_price.py +41 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/industry_theme.py +62 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/inquire_asking_price.py +130 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/inquire_ccnl.py +55 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/inquire_daily_chartprice.py +60 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/inquire_search.py +88 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/inquire_time_indexchartprice.py +58 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/inquire_time_itemchartprice.py +65 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/multprice.py +89 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/price.py +45 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/price_detail.py +75 -0
- tooja/brokers/kis/raw/overseas_stock_quotations/search_info.py +89 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/__init__.py +0 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/brknews_title.py +67 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/colable_by_company.py +61 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/market_cap.py +60 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/new_highlow.py +62 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/news_title.py +51 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/period_rights.py +59 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/price_fluct.py +61 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/rights_by_ice.py +47 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/trade_growth.py +62 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/trade_pbmn.py +64 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/trade_turnover.py +63 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/trade_vol.py +64 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/updown_rate.py +64 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/volume_power.py +59 -0
- tooja/brokers/kis/raw/overseas_stock_quote_analysis/volume_surge.py +60 -0
- tooja/brokers/kis/raw/overseas_stock_trading/__init__.py +0 -0
- tooja/brokers/kis/raw/overseas_stock_trading/algo_ordno.py +47 -0
- tooja/brokers/kis/raw/overseas_stock_trading/daytime_order.py +44 -0
- tooja/brokers/kis/raw/overseas_stock_trading/daytime_order_rvsecncl.py +45 -0
- tooja/brokers/kis/raw/overseas_stock_trading/foreign_margin.py +44 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_algo_ccnl.py +64 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_balance.py +72 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_ccnl.py +80 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_nccs.py +68 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_paymt_stdr_balance.py +84 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_period_profit.py +69 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_period_trans.py +75 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_present_balance.py +110 -0
- tooja/brokers/kis/raw/overseas_stock_trading/inquire_psamount.py +48 -0
- tooja/brokers/kis/raw/overseas_stock_trading/order.py +49 -0
- tooja/brokers/kis/raw/overseas_stock_trading/order_resv.py +49 -0
- tooja/brokers/kis/raw/overseas_stock_trading/order_resv_ccnl.py +37 -0
- tooja/brokers/kis/raw/overseas_stock_trading/order_resv_list.py +66 -0
- tooja/brokers/kis/raw/overseas_stock_trading/order_rvsecncl.py +45 -0
- tooja/brokers/kis/raw/overseas_stock_ws/__init__.py +0 -0
- tooja/brokers/kis/raw/overseas_stock_ws/h0gscni0.py +43 -0
- tooja/brokers/kis/raw/overseas_stock_ws/hdfsasp0.py +94 -0
- tooja/brokers/kis/raw/overseas_stock_ws/hdfsasp1.py +35 -0
- tooja/brokers/kis/raw/overseas_stock_ws/hdfscnt0.py +44 -0
- tooja/brokers/kis/raw/ws_base.py +129 -0
- tooja/brokers/kis/raw_namespace.py +60 -0
- tooja/brokers/kis/stream.py +126 -0
- tooja/brokers/toss/__init__.py +3 -0
- tooja/brokers/toss/_call.py +142 -0
- tooja/brokers/toss/_mappers.py +308 -0
- tooja/brokers/toss/_rate_limit.py +20 -0
- tooja/brokers/toss/account.py +87 -0
- tooja/brokers/toss/analytics.py +22 -0
- tooja/brokers/toss/auth.py +89 -0
- tooja/brokers/toss/broker.py +123 -0
- tooja/brokers/toss/credentials.py +14 -0
- tooja/brokers/toss/info.py +114 -0
- tooja/brokers/toss/mapping.py +60 -0
- tooja/brokers/toss/market.py +167 -0
- tooja/brokers/toss/orders.py +191 -0
- tooja/brokers/toss/rankings.py +21 -0
- tooja/brokers/toss/raw/__init__.py +0 -0
- tooja/brokers/toss/raw/account/__init__.py +0 -0
- tooja/brokers/toss/raw/account/get_accounts.py +21 -0
- tooja/brokers/toss/raw/asset/__init__.py +0 -0
- tooja/brokers/toss/raw/asset/get_holdings.py +17 -0
- tooja/brokers/toss/raw/auth/__init__.py +0 -0
- tooja/brokers/toss/raw/auth/issue_o_auth2_token.py +16 -0
- tooja/brokers/toss/raw/base.py +167 -0
- tooja/brokers/toss/raw/market_data/__init__.py +0 -0
- tooja/brokers/toss/raw/market_data/get_candles.py +16 -0
- tooja/brokers/toss/raw/market_data/get_orderbook.py +16 -0
- tooja/brokers/toss/raw/market_data/get_price_limit.py +16 -0
- tooja/brokers/toss/raw/market_data/get_prices.py +22 -0
- tooja/brokers/toss/raw/market_data/get_trades.py +22 -0
- tooja/brokers/toss/raw/market_info/__init__.py +0 -0
- tooja/brokers/toss/raw/market_info/get_exchange_rate.py +16 -0
- tooja/brokers/toss/raw/market_info/get_kr_market_calendar.py +16 -0
- tooja/brokers/toss/raw/market_info/get_us_market_calendar.py +16 -0
- tooja/brokers/toss/raw/models.py +505 -0
- tooja/brokers/toss/raw/order/__init__.py +0 -0
- tooja/brokers/toss/raw/order/cancel_order.py +17 -0
- tooja/brokers/toss/raw/order/create_order.py +16 -0
- tooja/brokers/toss/raw/order/modify_order.py +17 -0
- tooja/brokers/toss/raw/order_history/__init__.py +0 -0
- tooja/brokers/toss/raw/order_history/get_order.py +17 -0
- tooja/brokers/toss/raw/order_history/get_orders.py +17 -0
- tooja/brokers/toss/raw/order_info/__init__.py +0 -0
- tooja/brokers/toss/raw/order_info/get_buying_power.py +17 -0
- tooja/brokers/toss/raw/order_info/get_commissions.py +22 -0
- tooja/brokers/toss/raw/order_info/get_sellable_quantity.py +17 -0
- tooja/brokers/toss/raw/stock_info/__init__.py +0 -0
- tooja/brokers/toss/raw/stock_info/get_stock_warnings.py +22 -0
- tooja/brokers/toss/raw/stock_info/get_stocks.py +22 -0
- tooja/brokers/toss/raw_namespace.py +96 -0
- tooja/brokers/toss/stream.py +21 -0
- tooja/core/__init__.py +110 -0
- tooja/core/broker.py +76 -0
- tooja/core/clients.py +283 -0
- tooja/core/enums.py +80 -0
- tooja/core/errors.py +109 -0
- tooja/core/models.py +407 -0
- tooja/core/money.py +115 -0
- tooja/core/rate_limit.py +84 -0
- tooja/core/stream.py +79 -0
- tooja/core/token_cache.py +89 -0
- tooja/portfolio/__init__.py +5 -0
- tooja/portfolio/rebalance.py +180 -0
- tooja/py.typed +0 -0
- tooja-0.1.0.dist-info/METADATA +313 -0
- tooja-0.1.0.dist-info/RECORD +448 -0
- tooja-0.1.0.dist-info/WHEEL +4 -0
- tooja-0.1.0.dist-info/licenses/LICENSE +21 -0
tooja/__init__.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""tooja — unified Python client for Korean securities brokers.
|
|
2
|
+
|
|
3
|
+
A common, broker-agnostic abstraction with a raw escape hatch. The first
|
|
4
|
+
adapter targets Korea Investment & Securities (KIS).
|
|
5
|
+
|
|
6
|
+
from tooja.brokers.kis import KisBroker
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"""Shared call helper — wraps raw executor with auth header injection + error mapping.
|
|
2
|
+
|
|
3
|
+
Every subclient (market/account/orders/...) goes through `call(broker, executor)`:
|
|
4
|
+
1. acquire token bucket (client-side rate limit)
|
|
5
|
+
2. fetch access_token (retry once on EGW00123 token-expired)
|
|
6
|
+
3. inject standard auth headers + tr_id
|
|
7
|
+
4. execute
|
|
8
|
+
5. translate KisApiError -> mapped BrokerError via classify_kis_error
|
|
9
|
+
6. retry on EGW00201 (server-side rate limit) with exponential backoff
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import asyncio
|
|
15
|
+
import logging
|
|
16
|
+
from typing import TYPE_CHECKING, TypeVar
|
|
17
|
+
|
|
18
|
+
import httpx
|
|
19
|
+
|
|
20
|
+
from tooja.brokers.kis.mapping import classify_kis_error
|
|
21
|
+
from tooja.brokers.kis.raw.base import ApiExecutor, KisApiError, TokenExpiredError
|
|
22
|
+
from tooja.core.errors import BrokerAPIError, BrokerError, NetworkError
|
|
23
|
+
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from tooja.brokers.kis.broker import KisBroker
|
|
26
|
+
|
|
27
|
+
logger = logging.getLogger(__name__)
|
|
28
|
+
|
|
29
|
+
TResponse = TypeVar("TResponse")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
async def call(
|
|
33
|
+
broker: "KisBroker",
|
|
34
|
+
executor_cls: type[ApiExecutor],
|
|
35
|
+
request,
|
|
36
|
+
*,
|
|
37
|
+
tr_id: str | None = None,
|
|
38
|
+
extra_headers: dict[str, str] | None = None,
|
|
39
|
+
) -> object:
|
|
40
|
+
"""Execute one KIS REST call with auth + error mapping + retries.
|
|
41
|
+
|
|
42
|
+
`tr_id` defaults to executor's TR_ID (resolved for real/virtual env).
|
|
43
|
+
"""
|
|
44
|
+
broker._require_open() # noqa: SLF001 — peer module within the broker package
|
|
45
|
+
return await _call_with_retries(
|
|
46
|
+
broker, executor_cls, request, tr_id=tr_id, extra_headers=extra_headers,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
async def _call_with_retries(
|
|
51
|
+
broker: "KisBroker",
|
|
52
|
+
executor_cls: type[ApiExecutor],
|
|
53
|
+
request,
|
|
54
|
+
*,
|
|
55
|
+
tr_id: str | None,
|
|
56
|
+
extra_headers: dict[str, str] | None,
|
|
57
|
+
) -> object:
|
|
58
|
+
# Token-expiry retry is orthogonal to rate-limit retries: it doesn't
|
|
59
|
+
# consume an `attempt`. Otherwise a token expiring on the very last attempt
|
|
60
|
+
# would fall through to the unreachable branch instead of reissuing.
|
|
61
|
+
cfg = broker.rate_limit
|
|
62
|
+
token_retry_used = False
|
|
63
|
+
attempt = 0
|
|
64
|
+
while attempt <= cfg.max_retries:
|
|
65
|
+
try:
|
|
66
|
+
return await _call_once(
|
|
67
|
+
broker, executor_cls, request,
|
|
68
|
+
tr_id=tr_id, extra_headers=extra_headers,
|
|
69
|
+
)
|
|
70
|
+
except TokenExpiredError:
|
|
71
|
+
if token_retry_used:
|
|
72
|
+
raise
|
|
73
|
+
broker.invalidate_token()
|
|
74
|
+
token_retry_used = True
|
|
75
|
+
continue # do NOT increment attempt — token retry is free
|
|
76
|
+
except KisApiError as e:
|
|
77
|
+
if e.code != "EGW00201" or attempt == cfg.max_retries:
|
|
78
|
+
raise _translate(e, executor_cls.PATH) from e
|
|
79
|
+
backoff = cfg.base_backoff * (2 ** attempt)
|
|
80
|
+
logger.warning(
|
|
81
|
+
"KIS EGW00201 rate limited on %s; backing off %.2fs (attempt %d/%d)",
|
|
82
|
+
executor_cls.PATH, backoff, attempt + 1, cfg.max_retries,
|
|
83
|
+
)
|
|
84
|
+
await asyncio.sleep(backoff)
|
|
85
|
+
attempt += 1
|
|
86
|
+
# Unreachable: loop either returns or raises on every path above.
|
|
87
|
+
raise AssertionError("unreachable")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
async def _call_once(
|
|
91
|
+
broker: "KisBroker",
|
|
92
|
+
executor_cls: type[ApiExecutor],
|
|
93
|
+
request,
|
|
94
|
+
*,
|
|
95
|
+
tr_id: str | None,
|
|
96
|
+
extra_headers: dict[str, str] | None,
|
|
97
|
+
):
|
|
98
|
+
async with broker._rate_limiter: # noqa: SLF001 — peer module
|
|
99
|
+
token = await broker.get_access_token()
|
|
100
|
+
resolved_tr_id = tr_id or _resolve_tr_id(executor_cls, broker.is_virtual)
|
|
101
|
+
headers = broker.build_auth_headers(token, resolved_tr_id or "")
|
|
102
|
+
if extra_headers:
|
|
103
|
+
headers.update(extra_headers)
|
|
104
|
+
|
|
105
|
+
executor = executor_cls(
|
|
106
|
+
request=request,
|
|
107
|
+
headers=headers,
|
|
108
|
+
base_url=broker.base_url,
|
|
109
|
+
is_virtual=broker.is_virtual,
|
|
110
|
+
client=broker.http,
|
|
111
|
+
)
|
|
112
|
+
try:
|
|
113
|
+
return await executor.execute()
|
|
114
|
+
except httpx.TimeoutException as e:
|
|
115
|
+
from tooja.core.errors import TimeoutError as BTimeout
|
|
116
|
+
raise BTimeout(
|
|
117
|
+
f"KIS request timed out: {executor_cls.PATH}",
|
|
118
|
+
broker="kis",
|
|
119
|
+
endpoint=executor_cls.PATH,
|
|
120
|
+
) from e
|
|
121
|
+
except httpx.HTTPError as e:
|
|
122
|
+
raise NetworkError(
|
|
123
|
+
f"KIS network error: {e}",
|
|
124
|
+
broker="kis",
|
|
125
|
+
endpoint=executor_cls.PATH,
|
|
126
|
+
) from e
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def _resolve_tr_id(executor_cls: type[ApiExecutor], is_virtual: bool) -> str | None:
|
|
130
|
+
if is_virtual:
|
|
131
|
+
return executor_cls.TR_ID_VIRTUAL or executor_cls.TR_ID
|
|
132
|
+
return executor_cls.TR_ID
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _translate(err: KisApiError, endpoint: str) -> BrokerError:
|
|
136
|
+
cls = classify_kis_error(err.rt_cd, err.code, err.message) or BrokerAPIError
|
|
137
|
+
return cls(
|
|
138
|
+
err.message,
|
|
139
|
+
broker="kis",
|
|
140
|
+
raw_code=err.code,
|
|
141
|
+
raw_message=err.message,
|
|
142
|
+
endpoint=endpoint,
|
|
143
|
+
)
|