kuhl-haus-mdp-servers 0.1.8__tar.gz → 0.1.10__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.
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/PKG-INFO +1 -1
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/pyproject.toml +1 -1
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/mdl_server.py +13 -14
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/mdp_server.py +4 -4
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/LICENSE.txt +0 -0
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/README.md +0 -0
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/__init__.py +0 -0
- {kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/wds_server.py +0 -0
{kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/mdl_server.py
RENAMED
|
@@ -9,13 +9,12 @@ from fastapi import FastAPI, Response, status
|
|
|
9
9
|
from massive.websocket import Feed, Market
|
|
10
10
|
from pydantic_settings import BaseSettings
|
|
11
11
|
|
|
12
|
-
from kuhl_haus.mdp.
|
|
13
|
-
from kuhl_haus.mdp.
|
|
12
|
+
from kuhl_haus.mdp.components.massive_data_queues import MassiveDataQueues
|
|
13
|
+
from kuhl_haus.mdp.components.massive_data_listener import MassiveDataListener
|
|
14
14
|
from kuhl_haus.mdp.helpers.utils import get_massive_api_key
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class Settings(BaseSettings):
|
|
18
|
-
# TODO: Retrieve Massive client settings from Service Control Plane API call
|
|
19
18
|
# Massive/Polygon.io API Key
|
|
20
19
|
massive_api_key: str = get_massive_api_key()
|
|
21
20
|
|
|
@@ -24,9 +23,9 @@ class Settings(BaseSettings):
|
|
|
24
23
|
feed: Union[str, Feed] = os.environ.get("MASSIVE_FEED", Feed.RealTime)
|
|
25
24
|
market: Union[str, Market] = os.environ.get("MASSIVE_MARKET", Market.Stocks)
|
|
26
25
|
subscriptions: Optional[List[str]] = (
|
|
27
|
-
json.loads(os.environ.get("MASSIVE_SUBSCRIPTIONS", '["
|
|
26
|
+
json.loads(os.environ.get("MASSIVE_SUBSCRIPTIONS", '["A.*", "T.*", "Q.*", "LULD.*"]'))
|
|
28
27
|
if os.environ.get("MASSIVE_SUBSCRIPTIONS")
|
|
29
|
-
else ["
|
|
28
|
+
else ["A.*", "T.*", "Q.*", "LULD.*"]
|
|
30
29
|
)
|
|
31
30
|
|
|
32
31
|
# Additional Massive/Polygon.io Settings - default values can be overridden via environment variables
|
|
@@ -70,7 +69,7 @@ async def lifespan(app: FastAPI):
|
|
|
70
69
|
"""Startup and shutdown events"""
|
|
71
70
|
|
|
72
71
|
# Startup
|
|
73
|
-
logger.info("Instantiating
|
|
72
|
+
logger.info("Instantiating Massive Data Listener...")
|
|
74
73
|
global massive_data_listener, massive_data_queues
|
|
75
74
|
|
|
76
75
|
massive_data_queues = MassiveDataQueues(
|
|
@@ -92,20 +91,20 @@ async def lifespan(app: FastAPI):
|
|
|
92
91
|
max_reconnects=settings.max_reconnects,
|
|
93
92
|
secure=settings.secure,
|
|
94
93
|
)
|
|
95
|
-
logger.info("
|
|
94
|
+
logger.info("Massive Data Listener is ready.")
|
|
96
95
|
# NOTE: AUTO-START FEATURE IS DISABLED BY DEFAULT.
|
|
97
96
|
# Non-business licenses are limited to a single WebSocket connection for the entire account.
|
|
98
97
|
# The stop, start, and restart API functionality enables manual control of the WebSocket connection.
|
|
99
98
|
#
|
|
100
99
|
# To enable auto-start, set the environment variable MARKET_DATA_LISTENER_AUTO_START_ENABLED=true.
|
|
101
100
|
if settings.auto_start:
|
|
102
|
-
logger.info("[AUTO-START ENABLED]Starting
|
|
101
|
+
logger.info("[AUTO-START ENABLED]Starting Massive Data Listener...")
|
|
103
102
|
await massive_data_listener.start()
|
|
104
103
|
|
|
105
104
|
yield
|
|
106
105
|
|
|
107
106
|
# Shutdown
|
|
108
|
-
logger.info("Shutting down
|
|
107
|
+
logger.info("Shutting down Massive Data Listener...")
|
|
109
108
|
await stop_websocket_client()
|
|
110
109
|
await massive_data_queues.shutdown()
|
|
111
110
|
|
|
@@ -200,19 +199,19 @@ async def subscriptions(subscriptions_list: List[str]):
|
|
|
200
199
|
|
|
201
200
|
@app.get("/start")
|
|
202
201
|
async def start_websocket_client():
|
|
203
|
-
logger.info("Starting
|
|
202
|
+
logger.info("Starting Massive Data Listener...")
|
|
204
203
|
await massive_data_listener.start()
|
|
205
204
|
|
|
206
205
|
|
|
207
206
|
@app.get("/stop")
|
|
208
207
|
async def stop_websocket_client():
|
|
209
|
-
logger.info("Stopping
|
|
208
|
+
logger.info("Stopping Massive Data Listener...")
|
|
210
209
|
await massive_data_listener.stop()
|
|
211
210
|
|
|
212
211
|
|
|
213
212
|
@app.get("/restart")
|
|
214
213
|
async def restart_websocket_client():
|
|
215
|
-
logger.info("Restarting
|
|
214
|
+
logger.info("Restarting Massive Data Listener...")
|
|
216
215
|
await massive_data_listener.restart()
|
|
217
216
|
|
|
218
217
|
|
|
@@ -225,7 +224,7 @@ async def root():
|
|
|
225
224
|
else:
|
|
226
225
|
ret = "Unhealthy"
|
|
227
226
|
return {
|
|
228
|
-
"service": "
|
|
227
|
+
"service": "Massive Data Listener",
|
|
229
228
|
"status": ret,
|
|
230
229
|
"auto-start": settings.auto_start,
|
|
231
230
|
"container_image": settings.container_image,
|
|
@@ -248,7 +247,7 @@ async def health_check(response: Response):
|
|
|
248
247
|
# status_message = "Unhealthy"
|
|
249
248
|
# response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
|
|
250
249
|
return {
|
|
251
|
-
"service": "
|
|
250
|
+
"service": "Massive Data Listener",
|
|
252
251
|
"status": status_message,
|
|
253
252
|
"auto-start": settings.auto_start,
|
|
254
253
|
"container_image": settings.container_image,
|
{kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/mdp_server.py
RENAMED
|
@@ -14,10 +14,10 @@ from massive.rest import RESTClient
|
|
|
14
14
|
from kuhl_haus.mdp.analyzers.top_stocks import TopStocksAnalyzer
|
|
15
15
|
from kuhl_haus.mdp.components.market_data_scanner import MarketDataScanner
|
|
16
16
|
from kuhl_haus.mdp.components.market_data_cache import MarketDataCache
|
|
17
|
-
from kuhl_haus.mdp.
|
|
18
|
-
from kuhl_haus.mdp.
|
|
19
|
-
from kuhl_haus.mdp.
|
|
20
|
-
from kuhl_haus.mdp.
|
|
17
|
+
from kuhl_haus.mdp.components.massive_data_processor import MassiveDataProcessor
|
|
18
|
+
from kuhl_haus.mdp.enum.market_data_cache_keys import MarketDataCacheKeys
|
|
19
|
+
from kuhl_haus.mdp.enum.market_data_scanner_names import MarketDataScannerNames
|
|
20
|
+
from kuhl_haus.mdp.enum.massive_data_queue import MassiveDataQueue
|
|
21
21
|
from kuhl_haus.mdp.helpers.utils import get_massive_api_key
|
|
22
22
|
from kuhl_haus.mdp.helpers.process_manager import ProcessManager
|
|
23
23
|
|
|
File without changes
|
|
File without changes
|
{kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/__init__.py
RENAMED
|
File without changes
|
{kuhl_haus_mdp_servers-0.1.8 → kuhl_haus_mdp_servers-0.1.10}/src/kuhl_haus/servers/wds_server.py
RENAMED
|
File without changes
|