quantplay 2.0.57__tar.gz → 2.0.58__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.57 → quantplay-2.0.58}/PKG-INFO +1 -1
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/broker_factory.py +3 -1
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/dhan.py +9 -4
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/upstox.py +12 -31
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay.egg-info/PKG-INFO +1 -1
- {quantplay-2.0.57 → quantplay-2.0.58}/setup.py +1 -1
- {quantplay-2.0.57 → quantplay-2.0.58}/README.md +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/pyproject.toml +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/aliceblue.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/angelone.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/auto_login/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/auto_login/aliceblue.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/finvasia_utils/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/finvasia_utils/fa_noren.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/five_paisa.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/flattrade.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/ft_utils/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/ft_utils/flattrade_utils.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/ft_utils/ft_noren.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/generics/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/generics/broker.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/iifl_xts.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/kite_utils.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/kotak.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/motilal.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/noren.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/shoonya.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/uplink/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/uplink/uplink_utils.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/xts.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/xts_utils/Connect.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/xts_utils/Exception.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/xts_utils/InteractiveSocketClient.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/xts_utils/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/broker/zerodha.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/exception/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/exception/exceptions.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/model/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/model/broker.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/model/generics.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/model/instrument_data.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/model/order_event.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/py.typed +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/utils/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/utils/caching.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/utils/constant.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/utils/exchange.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/utils/number_utils.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/utils/pickle_utils.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/utils/selenium_utils.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/wrapper/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay/wrapper/aws/s3.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay.egg-info/SOURCES.txt +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay.egg-info/dependency_links.txt +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay.egg-info/requires.txt +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/quantplay.egg-info/top_level.txt +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/setup.cfg +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/tests/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/tests/conftest.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/tests/wrapper/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/tests/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.57 → quantplay-2.0.58}/tests/wrapper/aws/s3_test.py +0 -0
|
@@ -142,7 +142,9 @@ class BrokerFactory:
|
|
|
142
142
|
f"Missing Arguments for {user_broker_account['username']}:{user_broker_account['nickname']} in broker '{broker}' -> {compare_map[broker].difference(user_broker_account.keys())}"
|
|
143
143
|
)
|
|
144
144
|
|
|
145
|
-
def generate_token(
|
|
145
|
+
def generate_token(
|
|
146
|
+
self, user_broker_account: Dict[str, Any]
|
|
147
|
+
) -> Dict[str, BrokerType | Any]:
|
|
146
148
|
broker_client: BrokerType | None = None
|
|
147
149
|
|
|
148
150
|
broker_data = user_broker_account["broker_data"]
|
|
@@ -10,6 +10,7 @@ from quantplay.exception.exceptions import (
|
|
|
10
10
|
InvalidArgumentException,
|
|
11
11
|
QuantplayOrderPlacementException,
|
|
12
12
|
RetryableException,
|
|
13
|
+
TokenException,
|
|
13
14
|
retry_exception,
|
|
14
15
|
)
|
|
15
16
|
from quantplay.model.broker import (
|
|
@@ -32,10 +33,14 @@ class Dhan(Broker):
|
|
|
32
33
|
access_token: str,
|
|
33
34
|
load_instrument: bool = True,
|
|
34
35
|
):
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
try:
|
|
37
|
+
self.dhan = dhanhq(
|
|
38
|
+
client_id=user_id,
|
|
39
|
+
access_token=access_token,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
except Exception:
|
|
43
|
+
raise TokenException("Dhan Session Expired")
|
|
39
44
|
|
|
40
45
|
def load_instrument(self, file_name: str | None = None) -> None:
|
|
41
46
|
super().load_instrument("upstox_instruments")
|
|
@@ -51,39 +51,20 @@ class Upstox(Broker):
|
|
|
51
51
|
):
|
|
52
52
|
super().__init__()
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# TODO: Implement Auto Login
|
|
60
|
-
# elif (
|
|
61
|
-
# api_key
|
|
62
|
-
# and api_secret
|
|
63
|
-
# and totp
|
|
64
|
-
# and mobile_number
|
|
65
|
-
# and account_pin
|
|
66
|
-
# and redirect_url
|
|
67
|
-
# ):
|
|
68
|
-
# new_access_token = self.generate_token(
|
|
69
|
-
# api_key, api_secret, totp, mobile_number, account_pin, redirect_url
|
|
70
|
-
# )
|
|
71
|
-
# self.set_access_token(new_access_token)
|
|
72
|
-
|
|
73
|
-
# self.configuration = upstox_client.Configuration()
|
|
74
|
-
# self.configuration.access_token = self.access_token
|
|
75
|
-
|
|
76
|
-
else:
|
|
77
|
-
raise InvalidArgumentException("Missing Args")
|
|
78
|
-
|
|
79
|
-
except Exception as e:
|
|
80
|
-
raise e
|
|
54
|
+
if access_token:
|
|
55
|
+
self.set_access_token(access_token)
|
|
56
|
+
self.user_id = user_id
|
|
57
|
+
else:
|
|
58
|
+
raise TokenException("Upstox Session Expired")
|
|
81
59
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
60
|
+
try:
|
|
61
|
+
self.configuration = upstox_client.Configuration()
|
|
62
|
+
self.configuration.access_token = self.access_token
|
|
63
|
+
self.api_version = "2.0"
|
|
85
64
|
|
|
86
|
-
|
|
65
|
+
self.api_client = upstox_client.ApiClient(self.configuration)
|
|
66
|
+
except Exception:
|
|
67
|
+
raise TokenException("Upstox Session Expired")
|
|
87
68
|
|
|
88
69
|
if load_instrument:
|
|
89
70
|
self.load_instrument()
|
|
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
|