siglab-py 0.2.7__py3-none-any.whl → 0.2.8__py3-none-any.whl

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.

Potentially problematic release.


This version of siglab-py might be problematic. Click here for more details.

@@ -6,7 +6,6 @@ from typing import Any, Dict, List, Union
6
6
  import logging
7
7
  import json
8
8
  from redis import StrictRedis
9
- from sympy import false
10
9
 
11
10
  from ordergateway.client import DivisiblePosition, execute_positions
12
11
  from constants import JSON_SERIALIZABLE_TYPES
@@ -96,7 +95,7 @@ if __name__ == '__main__':
96
95
  side = 'sell',
97
96
  amount = 0.00100,
98
97
  leg_room_bps = 5,
99
- reduce_only=False,
98
+ reduce_only=True,
100
99
  order_type = 'limit',
101
100
  slices=1,
102
101
  wait_fill_threshold_ms=60000,
@@ -29,36 +29,27 @@ def slack_dispatch_notification(
29
29
  if not webhook_url:
30
30
  return
31
31
 
32
- slack_data = {
33
- "username": "NotificationBot",
32
+ data = {
33
+ "username": "x",
34
34
  "type": "section",
35
35
  "blocks": [
36
36
  {
37
37
  "type": "header",
38
- "text": {
39
- "type": "plain_text",
40
- "text": f"{title}"
41
- }
38
+ "text": { "type": "plain_text", "text": f"{title}" }
42
39
  },
43
40
  {
44
41
  "type": "section",
45
- "text": {
46
- "type": "mrkdwn",
47
- "text": message
48
- }
42
+ "text": { "type": "mrkdwn", "text": message }
49
43
  },
50
44
  {
51
45
  "type": "section",
52
- "text": {
53
- "type": "plain_text",
54
- "text": footer
55
- }
46
+ "text": { "type": "plain_text", "text": footer }
56
47
  }
57
48
  ]
58
49
  }
59
50
 
60
- byte_length = str(sys.getsizeof(slack_data, 2000))
61
- headers = {'Content-Type': "application/json", 'Content-Length': byte_length}
62
- response = requests.post(webhook_url, data=json.dumps(slack_data), headers=headers)
63
- if response.status_code != 200:
64
- raise Exception(response.status_code, response.text)
51
+ byte_size = str(sys.getsizeof(data, 2000))
52
+ req_headers = { 'Content-Length': byte_size, 'Content-Type': "application/json"}
53
+ rsp = requests.post(webhook_url, headers=req_headers, data=json.dumps(data))
54
+ if rsp.status_code != 200:
55
+ raise Exception(rsp.status_code, rsp.text)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siglab-py
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Market data fetches, TA calculations and generic order gateway.
5
5
  Author: r0bbarh00d
6
6
  Author-email: r0bbarh00d <r0bbarh00d@gmail.com>
@@ -16,7 +16,7 @@ siglab_py/ordergateway/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
16
16
  siglab_py/ordergateway/client.py,sha256=EwoVKxEcngIs8-b4MThPBdZfFIWJg1OFAKG9bwC5BYw,14826
17
17
  siglab_py/ordergateway/encrypt_keys_util.py,sha256=-qi87db8To8Yf1WS1Q_Cp2Ya7ZqgWlRqSHfNXCM7wE4,1339
18
18
  siglab_py/ordergateway/gateway.py,sha256=k1VM02F94gRORj6l0GFTrtPnUMXvFkEDxmEZqXZSI-E,41691
19
- siglab_py/ordergateway/test_ordergateway.py,sha256=KajC0oidfDIgboRazkteAXzx47FffVRligThzKKqgRk,4035
19
+ siglab_py/ordergateway/test_ordergateway.py,sha256=4PE2flp_soGcD3DrI7zJOzZndjkb6I5XaDrFNNq4Huo,4009
20
20
  siglab_py/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  siglab_py/tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  siglab_py/tests/integration/market_data_util_tests.py,sha256=X0CiSMDfsafKcmjVKknA03vUUbMV0fAZweb3D01ikYI,7174
@@ -29,8 +29,8 @@ siglab_py/util/aws_util.py,sha256=KGmjHrr1rpnnxr33nXHNzTul4tvyyxl9p6gpwNv0Ygc,25
29
29
  siglab_py/util/market_data_util.py,sha256=9Uze8DE5z90H4Qm15R55ZllAi5trUkwCAW-BWYbfaW8,19420
30
30
  siglab_py/util/notification_util.py,sha256=6TPyStp-F6g_NTN-sVG18_o35agV6tjayNtJ0A4axyk,2311
31
31
  siglab_py/util/retry_util.py,sha256=mxYuRFZRZoaQQjENcwPmxhxixtd1TFvbxIdPx4RwfRc,743
32
- siglab_py/util/slack_notification_util.py,sha256=Rs2hRnXZq1aglBAGFCuhmNex_w9M2z0ciUVIOvInBjc,1906
33
- siglab_py-0.2.7.dist-info/METADATA,sha256=ZQNZuD3RPM9WdE2t4KBGtq9HG1o4Xyc_z3db6ijRJn8,979
34
- siglab_py-0.2.7.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
35
- siglab_py-0.2.7.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
36
- siglab_py-0.2.7.dist-info/RECORD,,
32
+ siglab_py/util/slack_notification_util.py,sha256=sHiSKTzeF8tdoqN9l3a8CtU4dn3sWsyBOZPBzO0L9wQ,1682
33
+ siglab_py-0.2.8.dist-info/METADATA,sha256=7xpPcvd-2nRSlQaA5iBcmdpSbzbD56CwAgUJ6E2ehVE,979
34
+ siglab_py-0.2.8.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
35
+ siglab_py-0.2.8.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
36
+ siglab_py-0.2.8.dist-info/RECORD,,