quantplay 1.3.78__tar.gz → 1.3.80__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.
- {quantplay-1.3.78 → quantplay-1.3.80}/PKG-INFO +1 -1
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/kite_utils.py +12 -11
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay.egg-info/PKG-INFO +1 -1
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay.egg-info/requires.txt +1 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/setup.py +1 -1
- {quantplay-1.3.78 → quantplay-1.3.80}/README.md +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/backtest/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/backtest/backtest_trades.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/aliceblue.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/angelone.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/broker_client.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/client.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/finvasia_utils/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/finvasia_utils/shoonya.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/generics/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/generics/broker.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/iifl.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/iifl_xts.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/motilal.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/shoonya.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/symphony.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/xts.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/xts_utils/Connect.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/xts_utils/Exception.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/xts_utils/InteractiveSocketClient.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/xts_utils/MarketDataSocketClient.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/xts_utils/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/broker/zerodha.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/brokerage/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/brokerage/angelone/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/brokerage/angelone/angel_broker.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/brokerage/generics/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/brokerage/generics/broker.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/brokerage/zerodha/ZBroker.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/brokerage/zerodha/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/config/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/config/qplay_config.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/create_sample_data.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/data_modify_script.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/date_fix.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/exception/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/exception/exceptions.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/executor/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/executor/strategy_executor.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/indicators/Indicator.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/indicators/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/indicators/atr.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/model/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/model/exchange/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/model/exchange/instrument.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/model/exchange/order.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/model/exchange/tick.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/model/strategy/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/model/strategy/strategy_response.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/oms/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/order_execution/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/order_execution/execution_algorithm.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/order_execution/mean_price.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/reporting/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/reporting/strategy_report.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/reporting/visuals.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/service.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/services/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/services/market.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/services/tradelens.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/equities/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/equities/intraday/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/equities/overnight/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/futures/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/futures/overnight/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/options/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/options/intraday/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/options/intraday/ladder.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/options/intraday/musk.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/options/intraday/short_straddle.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategy/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategy/base.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategy_run.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/config_util.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/constant.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/data_utils.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/exchange.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/number_utils.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/pickle_utils.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/selenium_utils.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/utils/transaction_utils.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/wrapper/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/wrapper/aws/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay/wrapper/aws/s3.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay.egg-info/SOURCES.txt +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay.egg-info/dependency_links.txt +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/quantplay.egg-info/top_level.txt +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/setup.cfg +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/broker/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/broker/finvasia.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/executor/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/executor/strategy_executor.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/strategy/__init__.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/strategy/base.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/strategy/sample_strategy.py +0 -0
- {quantplay-1.3.78 → quantplay-1.3.80}/test/test_motilal.py +0 -0
|
@@ -12,6 +12,7 @@ from quantplay.exception.exceptions import (
|
|
|
12
12
|
)
|
|
13
13
|
import pyotp
|
|
14
14
|
from selenium.common.exceptions import WebDriverException
|
|
15
|
+
import undetected_chromedriver as uc
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class KiteUtils:
|
|
@@ -29,47 +30,47 @@ class KiteUtils:
|
|
|
29
30
|
def get_request_token(api_key=None, user_id=None, password=None, totp=None):
|
|
30
31
|
|
|
31
32
|
try:
|
|
32
|
-
|
|
33
|
+
driver = uc.Chrome(headless=True)
|
|
33
34
|
|
|
34
35
|
# TODO api should be fetched from configuration
|
|
35
36
|
|
|
36
37
|
kite_url = "https://kite.trade/connect/login?api_key={}&v=3".format(api_key)
|
|
37
38
|
print("Kite Url {}".format(kite_url))
|
|
38
|
-
|
|
39
|
+
driver.get(kite_url)
|
|
39
40
|
time.sleep(2)
|
|
40
|
-
page_source =
|
|
41
|
+
page_source = driver.page_source
|
|
41
42
|
if "Invalid `api_key" in page_source:
|
|
42
43
|
raise InvalidArgumentException(f"Invalid API Key [{api_key}]")
|
|
43
44
|
time.sleep(2)
|
|
44
45
|
|
|
45
|
-
user_id_element =
|
|
46
|
+
user_id_element = driver.find_element(
|
|
46
47
|
"xpath", '//*[@id="container"]/div/div/div[2]/form/div[1]/input'
|
|
47
48
|
)
|
|
48
|
-
password_element =
|
|
49
|
+
password_element = driver.find_element(
|
|
49
50
|
"xpath", '//*[@id="container"]/div/div/div[2]/form/div[2]/input'
|
|
50
51
|
)
|
|
51
52
|
|
|
52
53
|
user_id_element.send_keys(user_id)
|
|
53
54
|
password_element.send_keys(password)
|
|
54
55
|
|
|
55
|
-
login_attempt =
|
|
56
|
+
login_attempt = driver.find_element(
|
|
56
57
|
"xpath", '//*[@id="container"]/div/div/div[2]/form/div[4]/button'
|
|
57
58
|
)
|
|
58
59
|
login_attempt.submit()
|
|
59
60
|
time.sleep(2)
|
|
60
61
|
|
|
61
|
-
kite_pin =
|
|
62
|
+
kite_pin = driver.find_element(
|
|
62
63
|
"xpath",
|
|
63
64
|
"/html/body/div[1]/div/div[2]/div[1]/div[2]/div/div[2]/form/div[1]/input",
|
|
64
65
|
)
|
|
65
66
|
kite_pin.send_keys(pyotp.TOTP(totp).now())
|
|
66
67
|
time.sleep(1)
|
|
67
68
|
|
|
68
|
-
page_source =
|
|
69
|
+
page_source = driver.page_source
|
|
69
70
|
if "Authorize" in page_source:
|
|
70
71
|
try:
|
|
71
72
|
print(f"Authorizing {api_key}")
|
|
72
|
-
authorize =
|
|
73
|
+
authorize = driver.find_element(
|
|
73
74
|
"xpath",
|
|
74
75
|
"/html/body/div[1]/div/div[1]/div/div/form/div/button",
|
|
75
76
|
)
|
|
@@ -78,11 +79,11 @@ class KiteUtils:
|
|
|
78
79
|
except Exception as e:
|
|
79
80
|
print("Failed to Authorize")
|
|
80
81
|
|
|
81
|
-
url =
|
|
82
|
+
url = driver.current_url
|
|
82
83
|
print("got kite url {}".format(url))
|
|
83
84
|
request_token = url.split("token=")[1].split("&")[0]
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
driver.close()
|
|
86
87
|
|
|
87
88
|
return request_token
|
|
88
89
|
except InvalidArgumentException as e:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quantplay-1.3.78 → quantplay-1.3.80}/quantplay/strategies/options/intraday/short_straddle.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|