quantplay 2.0.165__tar.gz → 2.0.166__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.
Files changed (70) hide show
  1. {quantplay-2.0.165 → quantplay-2.0.166}/PKG-INFO +1 -1
  2. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/broker_factory.py +2 -0
  3. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/kotak.py +19 -8
  4. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/PKG-INFO +1 -1
  5. {quantplay-2.0.165 → quantplay-2.0.166}/setup.py +1 -1
  6. {quantplay-2.0.165 → quantplay-2.0.166}/README.md +0 -0
  7. {quantplay-2.0.165 → quantplay-2.0.166}/pyproject.toml +0 -0
  8. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/__init__.py +0 -0
  9. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/__init__.py +0 -0
  10. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/aliceblue.py +0 -0
  11. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/angelone.py +0 -0
  12. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/auto_login/__init__.py +0 -0
  13. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/auto_login/aliceblue.py +0 -0
  14. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/breeze/__init__.py +0 -0
  15. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/breeze/breeze_utils.py +0 -0
  16. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/dhan.py +0 -0
  17. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/finvasia_utils/__init__.py +0 -0
  18. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/finvasia_utils/fa_noren.py +0 -0
  19. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/five_paisa.py +0 -0
  20. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/flattrade.py +0 -0
  21. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/ft_utils/__init__.py +0 -0
  22. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/ft_utils/flattrade_utils.py +0 -0
  23. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/ft_utils/ft_noren.py +0 -0
  24. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/generics/__init__.py +0 -0
  25. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/generics/broker.py +0 -0
  26. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/icici_direct.py +0 -0
  27. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/iifl_xts.py +0 -0
  28. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/jainam_xts.py +0 -0
  29. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/kite_utils.py +0 -0
  30. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/motilal.py +0 -0
  31. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/noren.py +0 -0
  32. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/shoonya.py +0 -0
  33. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/uplink/__init__.py +0 -0
  34. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/uplink/uplink_utils.py +0 -0
  35. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/upstox.py +0 -0
  36. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts.py +0 -0
  37. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/Connect.py +0 -0
  38. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/Exception.py +0 -0
  39. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/InteractiveSocketClient.py +0 -0
  40. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/xts_utils/__init__.py +0 -0
  41. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/broker/zerodha.py +0 -0
  42. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/exception/__init__.py +0 -0
  43. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/exception/exceptions.py +0 -0
  44. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/__init__.py +0 -0
  45. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/broker.py +0 -0
  46. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/broker_response.py +0 -0
  47. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/generics.py +0 -0
  48. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/instrument_data.py +0 -0
  49. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/model/order_event.py +0 -0
  50. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/py.typed +0 -0
  51. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/__init__.py +0 -0
  52. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/caching.py +0 -0
  53. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/constant.py +0 -0
  54. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/exchange.py +0 -0
  55. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/number_utils.py +0 -0
  56. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/pickle_utils.py +0 -0
  57. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/utils/selenium_utils.py +0 -0
  58. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/wrapper/__init__.py +0 -0
  59. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/wrapper/aws/__init__.py +0 -0
  60. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay/wrapper/aws/s3.py +0 -0
  61. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/SOURCES.txt +0 -0
  62. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/dependency_links.txt +0 -0
  63. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/requires.txt +0 -0
  64. {quantplay-2.0.165 → quantplay-2.0.166}/quantplay.egg-info/top_level.txt +0 -0
  65. {quantplay-2.0.165 → quantplay-2.0.166}/setup.cfg +0 -0
  66. {quantplay-2.0.165 → quantplay-2.0.166}/tests/__init__.py +0 -0
  67. {quantplay-2.0.165 → quantplay-2.0.166}/tests/conftest.py +0 -0
  68. {quantplay-2.0.165 → quantplay-2.0.166}/tests/wrapper/__init__.py +0 -0
  69. {quantplay-2.0.165 → quantplay-2.0.166}/tests/wrapper/aws/__init__.py +0 -0
  70. {quantplay-2.0.165 → quantplay-2.0.166}/tests/wrapper/aws/s3_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quantplay
3
- Version: 2.0.165
3
+ Version: 2.0.166
4
4
  Summary: This python package will be stored in AWS CodeArtifact
5
5
  Home-page:
6
6
  Author:
@@ -188,6 +188,7 @@ class BrokerFactory:
188
188
  consumer_secret=broker_data["consumer_secret"],
189
189
  mobilenumber=broker_data["mobilenumber"],
190
190
  password=broker_data["password"],
191
+ otp=broker_data.get("otp"),
191
192
  load_instrument=False,
192
193
  )
193
194
 
@@ -386,6 +387,7 @@ class BrokerFactory:
386
387
  elif broker == Broker.KOTAK:
387
388
  broker_client = Kotak(
388
389
  configuration=broker_data["configuration"],
390
+ otp=broker_data.get("otp"),
389
391
  load_instrument=load_instrument,
390
392
  )
391
393
  elif broker == Broker.ZERODHA:
@@ -45,12 +45,13 @@ class Kotak(Broker):
45
45
  consumer_secret: str | None = None,
46
46
  mobilenumber: str | None = None,
47
47
  password: str | None = None,
48
+ otp: str | None = None,
48
49
  configuration: dict[str, str] | None = None,
49
50
  load_instrument: bool = True,
50
51
  ) -> None:
51
52
  super().__init__()
52
53
 
53
- self.configuration: dict[str, str] = {
54
+ self.configuration: dict[str, str | None] = {
54
55
  "fin_key": "X6Nk8cQhUgGmJ2vBdWw4sfzrz4L5En",
55
56
  }
56
57
 
@@ -60,15 +61,18 @@ class Kotak(Broker):
60
61
  "bearer_token": configuration["bearer_token"],
61
62
  "view_token": configuration["view_token"],
62
63
  "sid": configuration["sid"],
63
- "edit_token": configuration["edit_token"],
64
- "edit_sid": configuration["edit_sid"],
65
- "edit_rid": configuration["edit_rid"],
66
- "serverId": configuration["serverId"],
64
+ "edit_token": configuration.get("edit_token"),
65
+ "edit_sid": configuration.get("edit_sid"),
66
+ "edit_rid": configuration.get("edit_rid"),
67
+ "serverId": configuration.get("serverId"),
67
68
  }
68
69
 
69
70
  elif consumer_key and consumer_secret and mobilenumber and password:
70
71
  self.login(consumer_key, consumer_secret, mobilenumber, password)
71
72
 
73
+ if otp:
74
+ self.verify_2fa(otp)
75
+
72
76
  if load_instrument:
73
77
  self.load_instrument()
74
78
 
@@ -145,7 +149,14 @@ class Kotak(Broker):
145
149
 
146
150
  _generate_otp = json.loads(generate_otp_resp.text)
147
151
 
148
- def verify_2fa(self, otp: int) -> None:
152
+ def verify_2fa(self, otp: str) -> None:
153
+ if (
154
+ self.configuration["bearer_token"] is None
155
+ or self.configuration["sid"] is None
156
+ or self.configuration["view_token"] is None
157
+ ):
158
+ raise InvalidArgumentException("Missing Params")
159
+
149
160
  login_resp = requests.post(
150
161
  url=f"{PROD_BASE_URL}login/1.0/login/v2/validate",
151
162
  headers={
@@ -154,7 +165,7 @@ class Kotak(Broker):
154
165
  "Auth": self.configuration["view_token"],
155
166
  "Content-Type": "application/json",
156
167
  },
157
- data=json.dumps({"userId": self.kotakUserId, "otp": str(otp)}),
168
+ data=json.dumps({"userId": self.kotakUserId, "otp": otp}),
158
169
  )
159
170
 
160
171
  edit_token_resp = json.loads(login_resp.text)
@@ -580,7 +591,7 @@ class Kotak(Broker):
580
591
  url = f"{PROD_BASE_URL}{url}"
581
592
 
582
593
  request_headers = {
583
- "Authorization": "Bearer " + self.configuration["bearer_token"],
594
+ "Authorization": f'Bearer {self.configuration["bearer_token"]}',
584
595
  "Sid": self.configuration["edit_sid"],
585
596
  "Auth": self.configuration["edit_token"],
586
597
  "neo-fin-key": self.configuration["fin_key"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quantplay
3
- Version: 2.0.165
3
+ Version: 2.0.166
4
4
  Summary: This python package will be stored in AWS CodeArtifact
5
5
  Home-page:
6
6
  Author:
@@ -21,7 +21,7 @@ requirements = [
21
21
  setup(
22
22
  name="quantplay",
23
23
  long_description=Path("README.md").read_text(),
24
- version="2.0.165",
24
+ version="2.0.166",
25
25
  setup_requires=["pytest-runner"],
26
26
  install_requires=requirements,
27
27
  tests_require=[],
File without changes
File without changes
File without changes