upstox-python-sdk 2.17.0__tar.gz → 2.19.0__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.
- upstox_python_sdk-2.17.0/README.md → upstox-python-sdk-2.19.0/PKG-INFO +38 -281
- upstox_python_sdk-2.17.0/PKG-INFO → upstox-python-sdk-2.19.0/README.md +25 -306
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/setup.py +1 -1
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/__init__.py +0 -1
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/order_api.py +24 -6
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/order_controller_v_3_api.py +24 -6
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api_client.py +1 -1
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/__init__.py +0 -1
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_python_sdk.egg-info/PKG-INFO +30 -298
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_python_sdk.egg-info/SOURCES.txt +0 -3
- upstox_python_sdk-2.17.0/upstox_client/feeder/market_data_feeder.py +0 -92
- upstox_python_sdk-2.17.0/upstox_client/feeder/market_data_streamer.py +0 -78
- upstox_python_sdk-2.17.0/upstox_client/feeder/proto/MarketDataFeed_pb2.py +0 -56
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/LICENSE.txt +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/setup.cfg +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/__init__.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/sanity_test.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_analytics_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_api_gateway_error_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_batch_execution_summary.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_brokerage_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_brokerage_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_brokerage_wrapper_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_cancel_or_exit_multi_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_cancel_or_exit_multi_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_cancel_or_exit_order_error_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_cancel_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_cancel_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_cancel_order_v3_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_charge_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_convert_position_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_convert_position_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_convert_position_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_depth.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_depth_map.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_dp_plan.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_exchange_timing_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_brokerage_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_exchange_timing_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_full_market_quote_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_gtt_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_historical_candle_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_holdings_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_holiday_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_intra_day_candle_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_market_quote_last_traded_price_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_market_quote_ohlc_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_market_status_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_option_chain_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_option_contract_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_order_book_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_order_details_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_position_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_profile_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_profit_and_loss_charges_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_trade_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_trade_wise_profit_and_loss_data_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_trade_wise_profit_and_loss_meta_data_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_get_user_fund_margin_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_gtt_cancel_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_gtt_modify_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_gtt_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_gtt_order_details.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_gtt_place_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_gtt_rule.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_gtt_trigger_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_historical_candle_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_history_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_holdings_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_holiday_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_indie_user_init_token_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_indie_user_init_token_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_indie_user_token_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_instrument.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_instrument_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_intra_day_candle_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_login_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_logout_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_margin.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_margin_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_margin_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_market_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_market_holidays_and_timings_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_market_quote_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_market_quote_ohlc.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_market_quote_symbol.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_market_quote_symbol_ltp.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_market_status_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_modify_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_modify_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_modify_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_modify_order_v3_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_multi_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_multi_order_error.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_multi_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_multi_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_multi_order_summary.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_multi_order_v3_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_o_auth_client_exception.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_o_auth_client_exception_cause.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_o_auth_client_exception_cause_stack_trace.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_o_auth_client_exception_cause_suppressed.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_ohlc.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_option_strike_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_options_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_order_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_order_book_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_order_controller_v_3_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_order_metadata.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_other_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_place_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_place_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_place_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_place_order_v3_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_place_order_v3_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_portfolio_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_position_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_post_margin_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_post_trade_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_problem.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_profile_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_profit_and_loss_charges_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_profit_and_loss_charges_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_profit_and_loss_charges_wrapper_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_profit_and_loss_meta_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_profit_and_loss_meta_data_wrapper.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_profit_and_loss_other_charges_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_put_call_option_chain_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_rule.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_token_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_token_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_history_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_history_response_meta_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_history_response_page_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_history_response_trade_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_profit_and_loss_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_wise_meta_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_trade_wise_profit_and_loss_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_user_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_user_fund_margin_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_websocket_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_websocket_auth_redirect_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/test/test_websocket_auth_redirect_response_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/__init__.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/charge_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/expired_instrument_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/history_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/history_v3_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/login_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/market_holidays_and_timings_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/market_quote_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/market_quote_v3_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/options_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/portfolio_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/post_trade_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/trade_profit_and_loss_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/user_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/api/websocket_api.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/configuration.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/feeder.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/market_data_feeder_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/market_data_streamer_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/portfolio_data_feeder.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/portfolio_data_streamer.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/proto/MarketDataFeedV3_pb2.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/proto/__init__.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/feeder/streamer.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/__init__.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/analytics_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/api_gateway_error_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/batch_execution_summary.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/brokerage_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/brokerage_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/brokerage_wrapper_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/cancel_or_exit_multi_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/cancel_or_exit_multi_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/cancel_or_exit_order_error_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/cancel_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/cancel_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/cancel_order_v3_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/convert_position_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/convert_position_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/convert_position_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/depth.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/depth_map.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/dp_plan.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/exchange_timing_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/expired_future_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_brokerage_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_exchange_timing_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_expired_futures_contract_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_expiries.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_full_market_quote_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_gtt_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_historical_candle_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_holdings_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_holiday_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_intra_day_candle_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_market_quote_last_traded_price_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_market_quote_last_traded_price_response_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_market_quote_ohlc_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_market_quote_ohlc_response_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_market_quote_option_greek_response_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_market_status_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_option_chain_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_option_contract_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_order_book_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_order_details_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_position_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_profile_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_profit_and_loss_charges_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_trade_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_trade_wise_profit_and_loss_data_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_trade_wise_profit_and_loss_meta_data_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/get_user_fund_margin_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/gtt_cancel_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/gtt_modify_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/gtt_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/gtt_order_details.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/gtt_place_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/gtt_rule.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/gtt_trigger_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/historical_candle_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/holdings_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/holiday_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/indie_user_init_token_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/indie_user_init_token_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/indie_user_token_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/instrument.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/instrument_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/intra_day_candle_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/logout_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/margin.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/margin_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/margin_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_quote_ohlc.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_quote_ohlcv3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_quote_option_greek_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_quote_symbol.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_quote_symbol_ltp.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_quote_symbol_ltp_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/market_status_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/modify_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/modify_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/modify_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/modify_order_v3_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/multi_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/multi_order_error.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/multi_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/multi_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/multi_order_summary.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/multi_order_v3_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/o_auth_client_exception.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/o_auth_client_exception_cause.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/o_auth_client_exception_cause_stack_trace.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/o_auth_client_exception_cause_suppressed.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/ohlc.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/ohlc_v3.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/option_strike_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/order_book_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/order_metadata.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/other_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/place_order_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/place_order_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/place_order_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/place_order_v3_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/place_order_v3_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/position_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/post_margin_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/problem.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/profile_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/profit_and_loss_charges_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/profit_and_loss_charges_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/profit_and_loss_charges_wrapper_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/profit_and_loss_meta_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/profit_and_loss_meta_data_wrapper.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/profit_and_loss_other_charges_taxes.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/put_call_option_chain_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/rule.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/token_request.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/token_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/trade_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/trade_history_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/trade_history_response_meta_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/trade_history_response_page_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/trade_history_response_trade_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/trade_wise_meta_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/trade_wise_profit_and_loss_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/user_fund_margin_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/websocket_auth_redirect_response.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/models/websocket_auth_redirect_response_data.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_client/rest.py +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_python_sdk.egg-info/dependency_links.txt +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_python_sdk.egg-info/requires.txt +0 -0
- {upstox_python_sdk-2.17.0 → upstox-python-sdk-2.19.0}/upstox_python_sdk.egg-info/top_level.txt +0 -0
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: upstox-python-sdk
|
|
3
|
+
Version: 2.19.0
|
|
4
|
+
Summary: Upstox Developer API
|
|
5
|
+
Home-page: https://github.com/upstox/upstox-python
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: Upstox Developer API
|
|
8
|
+
Platform: UNKNOWN
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
|
|
1
12
|
# Upstox Python SDK for API v2
|
|
2
13
|
|
|
3
14
|
[](https://pypi.python.org/pypi/upstox-python-sdk)
|
|
@@ -9,7 +20,7 @@ The official Python client for communicating with the <a href="https://upstox.co
|
|
|
9
20
|
Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection.
|
|
10
21
|
|
|
11
22
|
- API version: v2
|
|
12
|
-
- Package version: 2.
|
|
23
|
+
- Package version: 2.19.0
|
|
13
24
|
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
|
|
14
25
|
|
|
15
26
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.
|
|
@@ -73,7 +84,31 @@ except ApiException as e:
|
|
|
73
84
|
```
|
|
74
85
|
To learn more about the sandbox environment and the available sandbox APIs, please visit the [Upstox API documentation - Sandbox](https://upstox.com/developer/api-documentation/sandbox).
|
|
75
86
|
|
|
87
|
+
## Algo ID Support
|
|
88
|
+
|
|
89
|
+
The SDK supports passing an algorithm ID for order tracking and management. When provided, the SDK will pass the algo ID as `X-Algo-Id` header.
|
|
76
90
|
|
|
91
|
+
```python
|
|
92
|
+
import upstox_client
|
|
93
|
+
from upstox_client.rest import ApiException
|
|
94
|
+
|
|
95
|
+
configuration = upstox_client.Configuration()
|
|
96
|
+
configuration.access_token = 'ACCESS_TOKEN'
|
|
97
|
+
|
|
98
|
+
api_instance = upstox_client.OrderApiV3(upstox_client.ApiClient(configuration))
|
|
99
|
+
body = upstox_client.PlaceOrderV3Request(quantity=1, product="D", validity="DAY", price=0,
|
|
100
|
+
instrument_token="NSE_EQ|INE528G01035", order_type="MARKET",
|
|
101
|
+
transaction_type="BUY", disclosed_quantity=0, trigger_price=0,
|
|
102
|
+
is_amo=False, slice=True)
|
|
103
|
+
|
|
104
|
+
try:
|
|
105
|
+
api_response = api_instance.place_order(body, algo_id="your-algo-id")
|
|
106
|
+
print(api_response)
|
|
107
|
+
except ApiException as e:
|
|
108
|
+
print("Exception when calling OrderApiV3->place_order: %s\n" % e)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Other order methods (modify, cancel, etc.) follow the same pattern by accepting an optional `algo_id` as a keyword parameter.
|
|
77
112
|
|
|
78
113
|
## Examples
|
|
79
114
|
|
|
@@ -158,9 +193,6 @@ Both functions are designed to simplify the process of subscribing to essential
|
|
|
158
193
|
|
|
159
194
|
### MarketDataStreamer
|
|
160
195
|
|
|
161
|
-
<details>
|
|
162
|
-
<summary style="cursor: pointer; font-size: 1.2em;">V3</summary>
|
|
163
|
-
<p>
|
|
164
196
|
|
|
165
197
|
The `MarketDataStreamerV3` interface is designed for effortless connection to the market WebSocket, enabling users to receive instantaneous updates on various instruments. The following example demonstrates how to quickly set up and start receiving market updates for selected instrument keys:
|
|
166
198
|
|
|
@@ -432,285 +464,8 @@ if __name__ == "__main__":
|
|
|
432
464
|
```
|
|
433
465
|
|
|
434
466
|
<br/>
|
|
435
|
-
</p>
|
|
436
|
-
</details>
|
|
437
|
-
|
|
438
|
-
<details>
|
|
439
|
-
<summary style="cursor: pointer; font-size: 1.2em;">V2</summary>
|
|
440
|
-
<p>
|
|
441
|
-
|
|
442
|
-
The `MarketDataStreamer` interface is designed for effortless connection to the market WebSocket, enabling users to receive instantaneous updates on various instruments. The following example demonstrates how to quickly set up and start receiving market updates for selected instrument keys:
|
|
443
|
-
|
|
444
|
-
```python
|
|
445
|
-
import upstox_client
|
|
446
|
-
|
|
447
|
-
def on_message(message):
|
|
448
|
-
print(message)
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
def main():
|
|
452
|
-
configuration = upstox_client.Configuration()
|
|
453
|
-
access_token = <ACCESS_TOKEN>
|
|
454
|
-
configuration.access_token = access_token
|
|
455
|
-
|
|
456
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
457
|
-
upstox_client.ApiClient(configuration), ["NSE_INDEX|Nifty 50", "NSE_INDEX|Nifty Bank"], "full")
|
|
458
|
-
|
|
459
|
-
streamer.on("message", on_message)
|
|
460
|
-
|
|
461
|
-
streamer.connect()
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
if __name__ == "__main__":
|
|
465
|
-
main()
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
In this example, you first authenticate using an access token, then instantiate MarketDataStreamer with specific instrument keys and a subscription mode. Upon connecting, the streamer listens for market updates, which are logged to the console as they arrive.
|
|
469
|
-
|
|
470
|
-
Feel free to adjust the access token placeholder and any other specifics to better fit your actual implementation or usage scenario.
|
|
471
|
-
|
|
472
|
-
### Exploring the MarketDataStreamer Functionality
|
|
473
|
-
|
|
474
|
-
#### Modes
|
|
475
|
-
- **ltpc**: ltpc provides information solely about the most recent trade, encompassing details such as the last trade price, time of the last trade, quantity traded, and the closing price from the previous day.
|
|
476
|
-
- **full**: The full option offers comprehensive information, including the latest trade prices, D5 depth, 1-minute, 30-minute, and daily candlestick data, along with some additional details.
|
|
477
|
-
|
|
478
|
-
#### Functions
|
|
479
|
-
1. **constructor MarketDataStreamer(apiClient, instrumentKeys, mode)**: Initializes the streamer with optional instrument keys and mode (`full` or `ltpc`).
|
|
480
|
-
2. **connect()**: Establishes the WebSocket connection.
|
|
481
|
-
3. **subscribe(instrumentKeys, mode)**: Subscribes to updates for given instrument keys in the specified mode. Both parameters are mandatory.
|
|
482
|
-
4. **unsubscribe(instrumentKeys)**: Stops updates for the specified instrument keys.
|
|
483
|
-
5. **changeMode(instrumentKeys, mode)**: Switches the mode for already subscribed instrument keys.
|
|
484
|
-
6. **disconnect()**: Ends the active WebSocket connection.
|
|
485
|
-
7. **auto_reconnect(enable, interval, retryCount)**: Customizes auto-reconnect functionality. Parameters include a flag to enable/disable it, the interval(in seconds) between attempts, and the maximum number of retries.
|
|
486
|
-
|
|
487
|
-
#### Events
|
|
488
|
-
- **open**: Emitted upon successful connection establishment.
|
|
489
|
-
- **close**: Indicates the WebSocket connection has been closed.
|
|
490
|
-
- **message**: Delivers market updates.
|
|
491
|
-
- **error**: Signals an error has occurred.
|
|
492
|
-
- **reconnecting**: Announced when a reconnect attempt is initiated.
|
|
493
|
-
- **autoReconnectStopped**: Informs when auto-reconnect efforts have ceased after exhausting the retry count.
|
|
494
|
-
|
|
495
|
-
The following documentation includes examples to illustrate the usage of these functions and events, providing a practical understanding of how to interact with the MarketDataStreamer effectively.
|
|
496
|
-
|
|
497
|
-
<br/>
|
|
498
|
-
|
|
499
|
-
1. Subscribing to Market Data on Connection Open with MarketDataStreamer
|
|
500
|
-
|
|
501
|
-
```python
|
|
502
|
-
import upstox_client
|
|
503
|
-
|
|
504
|
-
def main():
|
|
505
|
-
configuration = upstox_client.Configuration()
|
|
506
|
-
access_token = <ACCESS_TOKEN>
|
|
507
|
-
configuration.access_token = access_token
|
|
508
|
-
|
|
509
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
510
|
-
upstox_client.ApiClient(configuration))
|
|
511
|
-
|
|
512
|
-
def on_open():
|
|
513
|
-
streamer.subscribe(
|
|
514
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "full")
|
|
515
|
-
|
|
516
|
-
def on_message(message):
|
|
517
|
-
print(message)
|
|
518
|
-
|
|
519
|
-
streamer.on("open", on_open)
|
|
520
|
-
streamer.on("message", on_message)
|
|
521
|
-
|
|
522
|
-
streamer.connect()
|
|
523
|
-
|
|
524
|
-
if __name__ == "__main__":
|
|
525
|
-
main()
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
<br/>
|
|
529
|
-
|
|
530
|
-
2. Subscribing to Instruments with Delays
|
|
531
|
-
|
|
532
|
-
```python
|
|
533
|
-
import upstox_client
|
|
534
|
-
import time
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
def main():
|
|
538
|
-
configuration = upstox_client.Configuration()
|
|
539
|
-
access_token = <ACCESS_TOKEN>
|
|
540
|
-
configuration.access_token = access_token
|
|
541
|
-
|
|
542
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
543
|
-
upstox_client.ApiClient(configuration))
|
|
544
|
-
|
|
545
|
-
def on_open():
|
|
546
|
-
streamer.subscribe(
|
|
547
|
-
["NSE_EQ|INE020B01018"], "full")
|
|
548
|
-
|
|
549
|
-
# Handle incoming market data messages\
|
|
550
|
-
def on_message(message):
|
|
551
|
-
print(message)
|
|
552
|
-
|
|
553
|
-
streamer.on("open", on_open)
|
|
554
|
-
streamer.on("message", on_message)
|
|
555
|
-
|
|
556
|
-
streamer.connect()
|
|
557
|
-
|
|
558
|
-
time.sleep(5)
|
|
559
|
-
streamer.subscribe(
|
|
560
|
-
["NSE_EQ|INE467B01029"], "full")
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if __name__ == "__main__":
|
|
564
|
-
main()
|
|
565
|
-
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
<br/>
|
|
569
|
-
|
|
570
|
-
3. Subscribing and Unsubscribing to Instruments
|
|
571
|
-
|
|
572
|
-
```python
|
|
573
|
-
import upstox_client
|
|
574
|
-
import time
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
def main():
|
|
578
|
-
configuration = upstox_client.Configuration()
|
|
579
|
-
access_token = <ACCESS_TOKEN>
|
|
580
|
-
configuration.access_token = access_token
|
|
581
|
-
|
|
582
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
583
|
-
upstox_client.ApiClient(configuration))
|
|
584
|
-
|
|
585
|
-
def on_open():
|
|
586
|
-
print("Connected. Subscribing to instrument keys.")
|
|
587
|
-
streamer.subscribe(
|
|
588
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "full")
|
|
589
|
-
|
|
590
|
-
# Handle incoming market data messages\
|
|
591
|
-
def on_message(message):
|
|
592
|
-
print(message)
|
|
593
|
-
|
|
594
|
-
streamer.on("open", on_open)
|
|
595
|
-
streamer.on("message", on_message)
|
|
596
|
-
|
|
597
|
-
streamer.connect()
|
|
598
|
-
|
|
599
|
-
time.sleep(5)
|
|
600
|
-
print("Unsubscribing from instrument keys.")
|
|
601
|
-
streamer.unsubscribe(["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"])
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
if __name__ == "__main__":
|
|
605
|
-
main()
|
|
606
|
-
```
|
|
607
|
-
|
|
608
|
-
<br/>
|
|
609
|
-
|
|
610
|
-
4. Subscribe, Change Mode and Unsubscribe
|
|
611
|
-
|
|
612
|
-
```python
|
|
613
|
-
import upstox_client
|
|
614
|
-
import time
|
|
615
|
-
|
|
616
|
-
def main():
|
|
617
|
-
configuration = upstox_client.Configuration()
|
|
618
|
-
access_token = <ACCESS_TOKEN>
|
|
619
|
-
configuration.access_token = access_token
|
|
620
|
-
|
|
621
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
622
|
-
upstox_client.ApiClient(configuration))
|
|
623
|
-
|
|
624
|
-
def on_open():
|
|
625
|
-
print("Connected. Subscribing to instrument keys.")
|
|
626
|
-
streamer.subscribe(
|
|
627
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "full")
|
|
628
|
-
|
|
629
|
-
# Handle incoming market data messages\
|
|
630
|
-
def on_message(message):
|
|
631
|
-
print(message)
|
|
632
|
-
|
|
633
|
-
streamer.on("open", on_open)
|
|
634
|
-
streamer.on("message", on_message)
|
|
635
|
-
|
|
636
|
-
streamer.connect()
|
|
637
|
-
|
|
638
|
-
time.sleep(5)
|
|
639
|
-
print("Changing subscription mode to ltpc...")
|
|
640
|
-
streamer.change_mode(
|
|
641
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "ltpc")
|
|
642
|
-
|
|
643
|
-
time.sleep(5)
|
|
644
|
-
print("Unsubscribing from instrument keys.")
|
|
645
|
-
streamer.unsubscribe(["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"])
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
if __name__ == "__main__":
|
|
649
|
-
main()
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
<br/>
|
|
653
|
-
|
|
654
|
-
5. Disable Auto-Reconnect
|
|
655
|
-
|
|
656
|
-
```python
|
|
657
|
-
import upstox_client
|
|
658
|
-
import time
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
def main():
|
|
662
|
-
configuration = upstox_client.Configuration()
|
|
663
|
-
access_token = <ACCESS_TOKEN>
|
|
664
|
-
configuration.access_token = access_token
|
|
665
|
-
|
|
666
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
667
|
-
upstox_client.ApiClient(configuration))
|
|
668
|
-
|
|
669
|
-
def on_reconnection_halt(message):
|
|
670
|
-
print(message)
|
|
671
|
-
|
|
672
|
-
streamer.on("autoReconnectStopped", on_reconnection_halt)
|
|
673
|
-
|
|
674
|
-
# Disable auto-reconnect feature
|
|
675
|
-
streamer.auto_reconnect(False)
|
|
676
|
-
|
|
677
|
-
streamer.connect()
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
if __name__ == "__main__":
|
|
681
|
-
main()
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
<br/>
|
|
685
|
-
|
|
686
|
-
6. Modify Auto-Reconnect parameters
|
|
687
|
-
|
|
688
|
-
```python
|
|
689
|
-
import upstox_client
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
def main():
|
|
693
|
-
configuration = upstox_client.Configuration()
|
|
694
|
-
access_token = <ACCESS_TOKEN>
|
|
695
|
-
configuration.access_token = access_token
|
|
696
|
-
|
|
697
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
698
|
-
upstox_client.ApiClient(configuration))
|
|
699
|
-
|
|
700
|
-
# Modify auto-reconnect parameters: enable it, set interval to 10 seconds, and retry count to 3
|
|
701
|
-
streamer.auto_reconnect(True, 10, 3)
|
|
702
|
-
|
|
703
|
-
streamer.connect()
|
|
704
467
|
|
|
705
468
|
|
|
706
|
-
if __name__ == "__main__":
|
|
707
|
-
main()
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
<br/>
|
|
711
|
-
</p>
|
|
712
|
-
</details>
|
|
713
|
-
|
|
714
469
|
### PortfolioDataStreamer
|
|
715
470
|
|
|
716
471
|
Connecting to the Portfolio WebSocket for real-time order updates is straightforward with the PortfolioDataStreamer function. Below is a concise guide to get you started on receiving updates:
|
|
@@ -929,3 +684,5 @@ if __name__ == "__main__":
|
|
|
929
684
|
- [WebsocketAuthRedirectResponse](docs/WebsocketAuthRedirectResponse.md)
|
|
930
685
|
- [WebsocketAuthRedirectResponseData](docs/WebsocketAuthRedirectResponseData.md)
|
|
931
686
|
|
|
687
|
+
|
|
688
|
+
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: upstox-python-sdk
|
|
3
|
-
Version: 2.17.0
|
|
4
|
-
Summary: Upstox Developer API
|
|
5
|
-
Home-page: https://github.com/upstox/upstox-python
|
|
6
|
-
License: MIT
|
|
7
|
-
Keywords: Upstox Developer API
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE.txt
|
|
10
|
-
Requires-Dist: urllib3>=1.15
|
|
11
|
-
Requires-Dist: six>=1.10
|
|
12
|
-
Requires-Dist: certifi
|
|
13
|
-
Requires-Dist: python-dateutil
|
|
14
|
-
Requires-Dist: websocket-client
|
|
15
|
-
Requires-Dist: uuid
|
|
16
|
-
Requires-Dist: protobuf
|
|
17
|
-
Dynamic: description
|
|
18
|
-
Dynamic: description-content-type
|
|
19
|
-
Dynamic: home-page
|
|
20
|
-
Dynamic: keywords
|
|
21
|
-
Dynamic: license
|
|
22
|
-
Dynamic: license-file
|
|
23
|
-
Dynamic: requires-dist
|
|
24
|
-
Dynamic: summary
|
|
25
|
-
|
|
26
1
|
# Upstox Python SDK for API v2
|
|
27
2
|
|
|
28
3
|
[](https://pypi.python.org/pypi/upstox-python-sdk)
|
|
@@ -34,7 +9,7 @@ The official Python client for communicating with the <a href="https://upstox.co
|
|
|
34
9
|
Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection.
|
|
35
10
|
|
|
36
11
|
- API version: v2
|
|
37
|
-
- Package version: 2.
|
|
12
|
+
- Package version: 2.19.0
|
|
38
13
|
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
|
|
39
14
|
|
|
40
15
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.
|
|
@@ -98,7 +73,31 @@ except ApiException as e:
|
|
|
98
73
|
```
|
|
99
74
|
To learn more about the sandbox environment and the available sandbox APIs, please visit the [Upstox API documentation - Sandbox](https://upstox.com/developer/api-documentation/sandbox).
|
|
100
75
|
|
|
76
|
+
## Algo ID Support
|
|
77
|
+
|
|
78
|
+
The SDK supports passing an algorithm ID for order tracking and management. When provided, the SDK will pass the algo ID as `X-Algo-Id` header.
|
|
101
79
|
|
|
80
|
+
```python
|
|
81
|
+
import upstox_client
|
|
82
|
+
from upstox_client.rest import ApiException
|
|
83
|
+
|
|
84
|
+
configuration = upstox_client.Configuration()
|
|
85
|
+
configuration.access_token = 'ACCESS_TOKEN'
|
|
86
|
+
|
|
87
|
+
api_instance = upstox_client.OrderApiV3(upstox_client.ApiClient(configuration))
|
|
88
|
+
body = upstox_client.PlaceOrderV3Request(quantity=1, product="D", validity="DAY", price=0,
|
|
89
|
+
instrument_token="NSE_EQ|INE528G01035", order_type="MARKET",
|
|
90
|
+
transaction_type="BUY", disclosed_quantity=0, trigger_price=0,
|
|
91
|
+
is_amo=False, slice=True)
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
api_response = api_instance.place_order(body, algo_id="your-algo-id")
|
|
95
|
+
print(api_response)
|
|
96
|
+
except ApiException as e:
|
|
97
|
+
print("Exception when calling OrderApiV3->place_order: %s\n" % e)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Other order methods (modify, cancel, etc.) follow the same pattern by accepting an optional `algo_id` as a keyword parameter.
|
|
102
101
|
|
|
103
102
|
## Examples
|
|
104
103
|
|
|
@@ -183,9 +182,6 @@ Both functions are designed to simplify the process of subscribing to essential
|
|
|
183
182
|
|
|
184
183
|
### MarketDataStreamer
|
|
185
184
|
|
|
186
|
-
<details>
|
|
187
|
-
<summary style="cursor: pointer; font-size: 1.2em;">V3</summary>
|
|
188
|
-
<p>
|
|
189
185
|
|
|
190
186
|
The `MarketDataStreamerV3` interface is designed for effortless connection to the market WebSocket, enabling users to receive instantaneous updates on various instruments. The following example demonstrates how to quickly set up and start receiving market updates for selected instrument keys:
|
|
191
187
|
|
|
@@ -457,284 +453,7 @@ if __name__ == "__main__":
|
|
|
457
453
|
```
|
|
458
454
|
|
|
459
455
|
<br/>
|
|
460
|
-
</p>
|
|
461
|
-
</details>
|
|
462
|
-
|
|
463
|
-
<details>
|
|
464
|
-
<summary style="cursor: pointer; font-size: 1.2em;">V2</summary>
|
|
465
|
-
<p>
|
|
466
|
-
|
|
467
|
-
The `MarketDataStreamer` interface is designed for effortless connection to the market WebSocket, enabling users to receive instantaneous updates on various instruments. The following example demonstrates how to quickly set up and start receiving market updates for selected instrument keys:
|
|
468
|
-
|
|
469
|
-
```python
|
|
470
|
-
import upstox_client
|
|
471
|
-
|
|
472
|
-
def on_message(message):
|
|
473
|
-
print(message)
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
def main():
|
|
477
|
-
configuration = upstox_client.Configuration()
|
|
478
|
-
access_token = <ACCESS_TOKEN>
|
|
479
|
-
configuration.access_token = access_token
|
|
480
|
-
|
|
481
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
482
|
-
upstox_client.ApiClient(configuration), ["NSE_INDEX|Nifty 50", "NSE_INDEX|Nifty Bank"], "full")
|
|
483
|
-
|
|
484
|
-
streamer.on("message", on_message)
|
|
485
|
-
|
|
486
|
-
streamer.connect()
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
if __name__ == "__main__":
|
|
490
|
-
main()
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
In this example, you first authenticate using an access token, then instantiate MarketDataStreamer with specific instrument keys and a subscription mode. Upon connecting, the streamer listens for market updates, which are logged to the console as they arrive.
|
|
494
|
-
|
|
495
|
-
Feel free to adjust the access token placeholder and any other specifics to better fit your actual implementation or usage scenario.
|
|
496
|
-
|
|
497
|
-
### Exploring the MarketDataStreamer Functionality
|
|
498
|
-
|
|
499
|
-
#### Modes
|
|
500
|
-
- **ltpc**: ltpc provides information solely about the most recent trade, encompassing details such as the last trade price, time of the last trade, quantity traded, and the closing price from the previous day.
|
|
501
|
-
- **full**: The full option offers comprehensive information, including the latest trade prices, D5 depth, 1-minute, 30-minute, and daily candlestick data, along with some additional details.
|
|
502
|
-
|
|
503
|
-
#### Functions
|
|
504
|
-
1. **constructor MarketDataStreamer(apiClient, instrumentKeys, mode)**: Initializes the streamer with optional instrument keys and mode (`full` or `ltpc`).
|
|
505
|
-
2. **connect()**: Establishes the WebSocket connection.
|
|
506
|
-
3. **subscribe(instrumentKeys, mode)**: Subscribes to updates for given instrument keys in the specified mode. Both parameters are mandatory.
|
|
507
|
-
4. **unsubscribe(instrumentKeys)**: Stops updates for the specified instrument keys.
|
|
508
|
-
5. **changeMode(instrumentKeys, mode)**: Switches the mode for already subscribed instrument keys.
|
|
509
|
-
6. **disconnect()**: Ends the active WebSocket connection.
|
|
510
|
-
7. **auto_reconnect(enable, interval, retryCount)**: Customizes auto-reconnect functionality. Parameters include a flag to enable/disable it, the interval(in seconds) between attempts, and the maximum number of retries.
|
|
511
|
-
|
|
512
|
-
#### Events
|
|
513
|
-
- **open**: Emitted upon successful connection establishment.
|
|
514
|
-
- **close**: Indicates the WebSocket connection has been closed.
|
|
515
|
-
- **message**: Delivers market updates.
|
|
516
|
-
- **error**: Signals an error has occurred.
|
|
517
|
-
- **reconnecting**: Announced when a reconnect attempt is initiated.
|
|
518
|
-
- **autoReconnectStopped**: Informs when auto-reconnect efforts have ceased after exhausting the retry count.
|
|
519
|
-
|
|
520
|
-
The following documentation includes examples to illustrate the usage of these functions and events, providing a practical understanding of how to interact with the MarketDataStreamer effectively.
|
|
521
|
-
|
|
522
|
-
<br/>
|
|
523
|
-
|
|
524
|
-
1. Subscribing to Market Data on Connection Open with MarketDataStreamer
|
|
525
|
-
|
|
526
|
-
```python
|
|
527
|
-
import upstox_client
|
|
528
|
-
|
|
529
|
-
def main():
|
|
530
|
-
configuration = upstox_client.Configuration()
|
|
531
|
-
access_token = <ACCESS_TOKEN>
|
|
532
|
-
configuration.access_token = access_token
|
|
533
|
-
|
|
534
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
535
|
-
upstox_client.ApiClient(configuration))
|
|
536
|
-
|
|
537
|
-
def on_open():
|
|
538
|
-
streamer.subscribe(
|
|
539
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "full")
|
|
540
|
-
|
|
541
|
-
def on_message(message):
|
|
542
|
-
print(message)
|
|
543
|
-
|
|
544
|
-
streamer.on("open", on_open)
|
|
545
|
-
streamer.on("message", on_message)
|
|
546
|
-
|
|
547
|
-
streamer.connect()
|
|
548
|
-
|
|
549
|
-
if __name__ == "__main__":
|
|
550
|
-
main()
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
<br/>
|
|
554
|
-
|
|
555
|
-
2. Subscribing to Instruments with Delays
|
|
556
|
-
|
|
557
|
-
```python
|
|
558
|
-
import upstox_client
|
|
559
|
-
import time
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
def main():
|
|
563
|
-
configuration = upstox_client.Configuration()
|
|
564
|
-
access_token = <ACCESS_TOKEN>
|
|
565
|
-
configuration.access_token = access_token
|
|
566
|
-
|
|
567
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
568
|
-
upstox_client.ApiClient(configuration))
|
|
569
|
-
|
|
570
|
-
def on_open():
|
|
571
|
-
streamer.subscribe(
|
|
572
|
-
["NSE_EQ|INE020B01018"], "full")
|
|
573
|
-
|
|
574
|
-
# Handle incoming market data messages\
|
|
575
|
-
def on_message(message):
|
|
576
|
-
print(message)
|
|
577
|
-
|
|
578
|
-
streamer.on("open", on_open)
|
|
579
|
-
streamer.on("message", on_message)
|
|
580
|
-
|
|
581
|
-
streamer.connect()
|
|
582
|
-
|
|
583
|
-
time.sleep(5)
|
|
584
|
-
streamer.subscribe(
|
|
585
|
-
["NSE_EQ|INE467B01029"], "full")
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
if __name__ == "__main__":
|
|
589
|
-
main()
|
|
590
|
-
|
|
591
|
-
```
|
|
592
|
-
|
|
593
|
-
<br/>
|
|
594
|
-
|
|
595
|
-
3. Subscribing and Unsubscribing to Instruments
|
|
596
|
-
|
|
597
|
-
```python
|
|
598
|
-
import upstox_client
|
|
599
|
-
import time
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
def main():
|
|
603
|
-
configuration = upstox_client.Configuration()
|
|
604
|
-
access_token = <ACCESS_TOKEN>
|
|
605
|
-
configuration.access_token = access_token
|
|
606
|
-
|
|
607
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
608
|
-
upstox_client.ApiClient(configuration))
|
|
609
|
-
|
|
610
|
-
def on_open():
|
|
611
|
-
print("Connected. Subscribing to instrument keys.")
|
|
612
|
-
streamer.subscribe(
|
|
613
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "full")
|
|
614
|
-
|
|
615
|
-
# Handle incoming market data messages\
|
|
616
|
-
def on_message(message):
|
|
617
|
-
print(message)
|
|
618
|
-
|
|
619
|
-
streamer.on("open", on_open)
|
|
620
|
-
streamer.on("message", on_message)
|
|
621
|
-
|
|
622
|
-
streamer.connect()
|
|
623
|
-
|
|
624
|
-
time.sleep(5)
|
|
625
|
-
print("Unsubscribing from instrument keys.")
|
|
626
|
-
streamer.unsubscribe(["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"])
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
if __name__ == "__main__":
|
|
630
|
-
main()
|
|
631
|
-
```
|
|
632
|
-
|
|
633
|
-
<br/>
|
|
634
|
-
|
|
635
|
-
4. Subscribe, Change Mode and Unsubscribe
|
|
636
|
-
|
|
637
|
-
```python
|
|
638
|
-
import upstox_client
|
|
639
|
-
import time
|
|
640
|
-
|
|
641
|
-
def main():
|
|
642
|
-
configuration = upstox_client.Configuration()
|
|
643
|
-
access_token = <ACCESS_TOKEN>
|
|
644
|
-
configuration.access_token = access_token
|
|
645
|
-
|
|
646
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
647
|
-
upstox_client.ApiClient(configuration))
|
|
648
|
-
|
|
649
|
-
def on_open():
|
|
650
|
-
print("Connected. Subscribing to instrument keys.")
|
|
651
|
-
streamer.subscribe(
|
|
652
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "full")
|
|
653
456
|
|
|
654
|
-
# Handle incoming market data messages\
|
|
655
|
-
def on_message(message):
|
|
656
|
-
print(message)
|
|
657
|
-
|
|
658
|
-
streamer.on("open", on_open)
|
|
659
|
-
streamer.on("message", on_message)
|
|
660
|
-
|
|
661
|
-
streamer.connect()
|
|
662
|
-
|
|
663
|
-
time.sleep(5)
|
|
664
|
-
print("Changing subscription mode to ltpc...")
|
|
665
|
-
streamer.change_mode(
|
|
666
|
-
["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"], "ltpc")
|
|
667
|
-
|
|
668
|
-
time.sleep(5)
|
|
669
|
-
print("Unsubscribing from instrument keys.")
|
|
670
|
-
streamer.unsubscribe(["NSE_EQ|INE020B01018", "NSE_EQ|INE467B01029"])
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
if __name__ == "__main__":
|
|
674
|
-
main()
|
|
675
|
-
```
|
|
676
|
-
|
|
677
|
-
<br/>
|
|
678
|
-
|
|
679
|
-
5. Disable Auto-Reconnect
|
|
680
|
-
|
|
681
|
-
```python
|
|
682
|
-
import upstox_client
|
|
683
|
-
import time
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
def main():
|
|
687
|
-
configuration = upstox_client.Configuration()
|
|
688
|
-
access_token = <ACCESS_TOKEN>
|
|
689
|
-
configuration.access_token = access_token
|
|
690
|
-
|
|
691
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
692
|
-
upstox_client.ApiClient(configuration))
|
|
693
|
-
|
|
694
|
-
def on_reconnection_halt(message):
|
|
695
|
-
print(message)
|
|
696
|
-
|
|
697
|
-
streamer.on("autoReconnectStopped", on_reconnection_halt)
|
|
698
|
-
|
|
699
|
-
# Disable auto-reconnect feature
|
|
700
|
-
streamer.auto_reconnect(False)
|
|
701
|
-
|
|
702
|
-
streamer.connect()
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
if __name__ == "__main__":
|
|
706
|
-
main()
|
|
707
|
-
```
|
|
708
|
-
|
|
709
|
-
<br/>
|
|
710
|
-
|
|
711
|
-
6. Modify Auto-Reconnect parameters
|
|
712
|
-
|
|
713
|
-
```python
|
|
714
|
-
import upstox_client
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
def main():
|
|
718
|
-
configuration = upstox_client.Configuration()
|
|
719
|
-
access_token = <ACCESS_TOKEN>
|
|
720
|
-
configuration.access_token = access_token
|
|
721
|
-
|
|
722
|
-
streamer = upstox_client.MarketDataStreamer(
|
|
723
|
-
upstox_client.ApiClient(configuration))
|
|
724
|
-
|
|
725
|
-
# Modify auto-reconnect parameters: enable it, set interval to 10 seconds, and retry count to 3
|
|
726
|
-
streamer.auto_reconnect(True, 10, 3)
|
|
727
|
-
|
|
728
|
-
streamer.connect()
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if __name__ == "__main__":
|
|
732
|
-
main()
|
|
733
|
-
```
|
|
734
|
-
|
|
735
|
-
<br/>
|
|
736
|
-
</p>
|
|
737
|
-
</details>
|
|
738
457
|
|
|
739
458
|
### PortfolioDataStreamer
|
|
740
459
|
|