quantplay 2.0.59__tar.gz → 2.0.61__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-2.0.59 → quantplay-2.0.61}/PKG-INFO +1 -1
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/broker_factory.py +8 -7
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/five_paisa.py +3 -3
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/flattrade.py +3 -3
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/uplink/uplink_utils.py +2 -2
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay.egg-info/PKG-INFO +1 -1
- {quantplay-2.0.59 → quantplay-2.0.61}/setup.py +1 -1
- {quantplay-2.0.59 → quantplay-2.0.61}/README.md +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/pyproject.toml +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/aliceblue.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/angelone.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/auto_login/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/auto_login/aliceblue.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/dhan.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/finvasia_utils/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/finvasia_utils/fa_noren.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/ft_utils/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/ft_utils/flattrade_utils.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/ft_utils/ft_noren.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/generics/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/generics/broker.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/iifl_xts.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/kite_utils.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/kotak.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/motilal.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/noren.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/shoonya.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/uplink/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/upstox.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/xts.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/xts_utils/Connect.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/xts_utils/Exception.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/xts_utils/InteractiveSocketClient.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/xts_utils/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/broker/zerodha.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/exception/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/exception/exceptions.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/model/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/model/broker.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/model/generics.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/model/instrument_data.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/model/order_event.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/py.typed +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/utils/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/utils/caching.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/utils/constant.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/utils/exchange.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/utils/number_utils.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/utils/pickle_utils.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/utils/selenium_utils.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/wrapper/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay/wrapper/aws/s3.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay.egg-info/SOURCES.txt +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay.egg-info/dependency_links.txt +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay.egg-info/requires.txt +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/quantplay.egg-info/top_level.txt +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/setup.cfg +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/tests/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/tests/conftest.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/tests/wrapper/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/tests/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.59 → quantplay-2.0.61}/tests/wrapper/aws/s3_test.py +0 -0
|
@@ -5,6 +5,7 @@ import traceback
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from typing import Any, Dict
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
from quantplay.broker.aliceblue import Aliceblue
|
|
9
10
|
from quantplay.broker.angelone import AngelOne
|
|
10
11
|
from quantplay.broker.dhan import Dhan
|
|
@@ -16,7 +17,7 @@ from quantplay.broker.motilal import Motilal
|
|
|
16
17
|
from quantplay.broker.shoonya import FinvAsia
|
|
17
18
|
from quantplay.broker.upstox import Upstox
|
|
18
19
|
from quantplay.broker.zerodha import Zerodha
|
|
19
|
-
from quantplay.exception.exceptions import InvalidArgumentException
|
|
20
|
+
from quantplay.exception.exceptions import InvalidArgumentException, TokenException
|
|
20
21
|
from quantplay.utils.caching import InstrumentCache
|
|
21
22
|
from quantplay.utils.pickle_utils import PickleUtils
|
|
22
23
|
|
|
@@ -104,7 +105,7 @@ broker_generate_args = {
|
|
|
104
105
|
"user_key",
|
|
105
106
|
"encryption_key",
|
|
106
107
|
"client_id",
|
|
107
|
-
"
|
|
108
|
+
"totp",
|
|
108
109
|
"pin",
|
|
109
110
|
]
|
|
110
111
|
),
|
|
@@ -138,8 +139,8 @@ class BrokerFactory:
|
|
|
138
139
|
raise InvalidArgumentException(f"Unsupported Broker: '{broker}'")
|
|
139
140
|
|
|
140
141
|
if not compare_map[broker].issubset(broker_data.keys()):
|
|
141
|
-
raise
|
|
142
|
-
f"Missing Arguments for {user_broker_account['username']}:{user_broker_account['nickname']} in broker '{broker}' -> {compare_map[broker].difference(
|
|
142
|
+
raise TokenException(
|
|
143
|
+
f"Missing Arguments for {user_broker_account['username']}:{user_broker_account['nickname']} in broker '{broker}' -> {compare_map[broker].difference(broker_data.keys())}"
|
|
143
144
|
)
|
|
144
145
|
|
|
145
146
|
def generate_token(
|
|
@@ -241,7 +242,7 @@ class BrokerFactory:
|
|
|
241
242
|
api_secret=broker_data["api_secret"],
|
|
242
243
|
imei=broker_data["imei"],
|
|
243
244
|
password=broker_data["password"],
|
|
244
|
-
totp=broker_data["
|
|
245
|
+
totp=broker_data["totp"],
|
|
245
246
|
user_id=broker_data["user_id"],
|
|
246
247
|
vendor_code=broker_data["vendor_code"],
|
|
247
248
|
load_instrument=False,
|
|
@@ -255,7 +256,7 @@ class BrokerFactory:
|
|
|
255
256
|
user_id=broker_data["user_id"],
|
|
256
257
|
api_secret=broker_data["api_secret"],
|
|
257
258
|
password=broker_data["password"],
|
|
258
|
-
totp=broker_data["
|
|
259
|
+
totp=broker_data["totp"],
|
|
259
260
|
api_key=broker_data["api_key"],
|
|
260
261
|
load_instrument=False,
|
|
261
262
|
)
|
|
@@ -271,7 +272,7 @@ class BrokerFactory:
|
|
|
271
272
|
user_key=broker_data["user_key"],
|
|
272
273
|
encryption_key=broker_data["encryption_key"],
|
|
273
274
|
client_id=broker_data["client_id"],
|
|
274
|
-
|
|
275
|
+
totp=broker_data["totp"],
|
|
275
276
|
pin=broker_data["pin"],
|
|
276
277
|
load_instrument=False,
|
|
277
278
|
)
|
|
@@ -43,7 +43,7 @@ class FivePaisa(Broker):
|
|
|
43
43
|
user_key: str | None = None,
|
|
44
44
|
encryption_key: str | None = None,
|
|
45
45
|
client_id: str | None = None,
|
|
46
|
-
|
|
46
|
+
totp: str | None = None,
|
|
47
47
|
pin: str | None = None,
|
|
48
48
|
client: str | None = None,
|
|
49
49
|
load_instrument: bool = True,
|
|
@@ -74,10 +74,10 @@ class FivePaisa(Broker):
|
|
|
74
74
|
)
|
|
75
75
|
self.user_key = user_key
|
|
76
76
|
|
|
77
|
-
if
|
|
77
|
+
if totp is None:
|
|
78
78
|
raise InvalidArgumentException("TOTP Key is Missing")
|
|
79
79
|
|
|
80
|
-
self.client.get_totp_session(client_id, pyotp.TOTP(
|
|
80
|
+
self.client.get_totp_session(client_id, pyotp.TOTP(totp).now(), pin)
|
|
81
81
|
|
|
82
82
|
try:
|
|
83
83
|
self.margins()
|
|
@@ -37,7 +37,7 @@ class FlatTrade(Noren):
|
|
|
37
37
|
token = self.login(
|
|
38
38
|
user_id=user_id,
|
|
39
39
|
password=password,
|
|
40
|
-
|
|
40
|
+
totp=totp,
|
|
41
41
|
api_key=api_key,
|
|
42
42
|
api_secret=api_secret,
|
|
43
43
|
)
|
|
@@ -67,12 +67,12 @@ class FlatTrade(Noren):
|
|
|
67
67
|
self,
|
|
68
68
|
user_id: str,
|
|
69
69
|
password: str,
|
|
70
|
-
|
|
70
|
+
totp: str,
|
|
71
71
|
api_key: str,
|
|
72
72
|
api_secret: str,
|
|
73
73
|
):
|
|
74
74
|
reqCode = FlatTradeUtils.get_request_code(
|
|
75
|
-
api_key=api_key, user_id=user_id, password=password, totp=
|
|
75
|
+
api_key=api_key, user_id=user_id, password=password, totp=totp
|
|
76
76
|
)
|
|
77
77
|
|
|
78
78
|
secret_code = api_key + reqCode + api_secret
|
|
@@ -62,7 +62,7 @@ class UplinkUtils:
|
|
|
62
62
|
def get_request_token(
|
|
63
63
|
api_key: str,
|
|
64
64
|
redirect_url: str,
|
|
65
|
-
|
|
65
|
+
totp: str,
|
|
66
66
|
mobile_number: str,
|
|
67
67
|
account_pin: str,
|
|
68
68
|
):
|
|
@@ -85,7 +85,7 @@ class UplinkUtils:
|
|
|
85
85
|
time.sleep(1)
|
|
86
86
|
|
|
87
87
|
totp_element = driver.find_element("xpath", UplinkUtils.totp_xpath)
|
|
88
|
-
totp_now = pyotp.TOTP(
|
|
88
|
+
totp_now = pyotp.TOTP(totp).now()
|
|
89
89
|
totp_element.send_keys(totp_now)
|
|
90
90
|
time.sleep(1)
|
|
91
91
|
|
|
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
|