mcli-framework 7.8.4__py3-none-any.whl → 7.9.0__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 mcli-framework might be problematic. Click here for more details.
- mcli/__init__.py +160 -0
- mcli/__main__.py +14 -0
- mcli/app/__init__.py +23 -0
- mcli/app/main.py +10 -17
- mcli/app/model/__init__.py +0 -0
- mcli/app/model_cmd.py +57 -472
- mcli/app/video/__init__.py +5 -0
- mcli/chat/__init__.py +34 -0
- mcli/lib/__init__.py +0 -0
- mcli/lib/api/__init__.py +0 -0
- mcli/lib/auth/__init__.py +1 -0
- mcli/lib/config/__init__.py +1 -0
- mcli/lib/erd/__init__.py +25 -0
- mcli/lib/files/__init__.py +0 -0
- mcli/lib/fs/__init__.py +1 -0
- mcli/lib/lib.py +8 -1
- mcli/lib/logger/__init__.py +3 -0
- mcli/lib/performance/__init__.py +17 -0
- mcli/lib/pickles/__init__.py +1 -0
- mcli/lib/secrets/__init__.py +10 -0
- mcli/lib/secrets/commands.py +185 -0
- mcli/lib/secrets/manager.py +213 -0
- mcli/lib/secrets/repl.py +297 -0
- mcli/lib/secrets/store.py +246 -0
- mcli/lib/shell/__init__.py +0 -0
- mcli/lib/toml/__init__.py +1 -0
- mcli/lib/watcher/__init__.py +0 -0
- mcli/ml/__init__.py +16 -0
- mcli/ml/api/__init__.py +30 -0
- mcli/ml/api/routers/__init__.py +27 -0
- mcli/ml/auth/__init__.py +41 -0
- mcli/ml/backtesting/__init__.py +33 -0
- mcli/ml/cli/__init__.py +5 -0
- mcli/ml/config/__init__.py +33 -0
- mcli/ml/configs/__init__.py +16 -0
- mcli/ml/dashboard/__init__.py +12 -0
- mcli/ml/dashboard/components/__init__.py +7 -0
- mcli/ml/dashboard/pages/__init__.py +6 -0
- mcli/ml/data_ingestion/__init__.py +29 -0
- mcli/ml/database/__init__.py +40 -0
- mcli/ml/experimentation/__init__.py +29 -0
- mcli/ml/features/__init__.py +39 -0
- mcli/ml/mlops/__init__.py +19 -0
- mcli/ml/models/__init__.py +90 -0
- mcli/ml/monitoring/__init__.py +25 -0
- mcli/ml/optimization/__init__.py +27 -0
- mcli/ml/predictions/__init__.py +5 -0
- mcli/ml/preprocessing/__init__.py +24 -0
- mcli/ml/scripts/__init__.py +1 -0
- mcli/ml/trading/__init__.py +63 -0
- mcli/ml/training/__init__.py +7 -0
- mcli/mygroup/__init__.py +3 -0
- mcli/public/__init__.py +1 -0
- mcli/public/commands/__init__.py +2 -0
- mcli/self/__init__.py +3 -0
- mcli/self/self_cmd.py +8 -0
- mcli/self/zsh_cmd.py +259 -0
- mcli/workflow/__init__.py +0 -0
- mcli/workflow/daemon/__init__.py +15 -0
- mcli/workflow/dashboard/__init__.py +5 -0
- mcli/workflow/docker/__init__.py +0 -0
- mcli/workflow/file/__init__.py +0 -0
- mcli/workflow/gcloud/__init__.py +1 -0
- mcli/workflow/git_commit/__init__.py +0 -0
- mcli/workflow/interview/__init__.py +0 -0
- mcli/workflow/politician_trading/__init__.py +4 -0
- mcli/workflow/registry/__init__.py +0 -0
- mcli/workflow/repo/__init__.py +0 -0
- mcli/workflow/scheduler/__init__.py +25 -0
- mcli/workflow/search/__init__.py +0 -0
- mcli/workflow/sync/__init__.py +5 -0
- mcli/workflow/videos/__init__.py +1 -0
- mcli/workflow/wakatime/__init__.py +80 -0
- {mcli_framework-7.8.4.dist-info → mcli_framework-7.9.0.dist-info}/METADATA +2 -1
- {mcli_framework-7.8.4.dist-info → mcli_framework-7.9.0.dist-info}/RECORD +79 -12
- mcli/app/chat_cmd.py +0 -42
- mcli/test/test_cmd.py +0 -20
- {mcli_framework-7.8.4.dist-info → mcli_framework-7.9.0.dist-info}/WHEEL +0 -0
- {mcli_framework-7.8.4.dist-info → mcli_framework-7.9.0.dist-info}/entry_points.txt +0 -0
- {mcli_framework-7.8.4.dist-info → mcli_framework-7.9.0.dist-info}/licenses/LICENSE +0 -0
- {mcli_framework-7.8.4.dist-info → mcli_framework-7.9.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Git-based secrets store for synchronization across machines.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import shutil
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any, Dict, Optional
|
|
9
|
+
|
|
10
|
+
import click
|
|
11
|
+
from git import GitCommandError, Repo
|
|
12
|
+
|
|
13
|
+
from mcli.lib.logger.logger import get_logger
|
|
14
|
+
|
|
15
|
+
logger = get_logger(__name__)
|
|
16
|
+
from mcli.lib.ui.styling import error, info, success, warning
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class SecretsStore:
|
|
20
|
+
"""Manages git-based secrets synchronization."""
|
|
21
|
+
|
|
22
|
+
def __init__(self, store_path: Optional[Path] = None):
|
|
23
|
+
"""Initialize the secrets store.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
store_path: Path to git repository for secrets. Defaults to ~/repos/mcli-secrets
|
|
27
|
+
"""
|
|
28
|
+
self.store_path = store_path or Path.home() / "repos" / "mcli-secrets"
|
|
29
|
+
self.config_file = Path.home() / ".mcli" / "secrets-store.conf"
|
|
30
|
+
self.load_config()
|
|
31
|
+
|
|
32
|
+
def load_config(self) -> None:
|
|
33
|
+
"""Load store configuration."""
|
|
34
|
+
self.store_config = {}
|
|
35
|
+
if self.config_file.exists():
|
|
36
|
+
with open(self.config_file) as f:
|
|
37
|
+
for line in f:
|
|
38
|
+
line = line.strip()
|
|
39
|
+
if "=" in line:
|
|
40
|
+
key, value = line.split("=", 1)
|
|
41
|
+
self.store_config[key.strip()] = value.strip()
|
|
42
|
+
|
|
43
|
+
# Override store path if configured
|
|
44
|
+
if "store_path" in self.store_config:
|
|
45
|
+
self.store_path = Path(self.store_config["store_path"])
|
|
46
|
+
|
|
47
|
+
def save_config(self) -> None:
|
|
48
|
+
"""Save store configuration."""
|
|
49
|
+
self.config_file.parent.mkdir(parents=True, exist_ok=True)
|
|
50
|
+
with open(self.config_file, "w") as f:
|
|
51
|
+
for key, value in self.store_config.items():
|
|
52
|
+
f.write(f"{key}={value}\n")
|
|
53
|
+
|
|
54
|
+
def init(self, remote_url: Optional[str] = None) -> None:
|
|
55
|
+
"""Initialize the secrets store repository.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
remote_url: Optional git remote URL
|
|
59
|
+
"""
|
|
60
|
+
if self.store_path.exists() and (self.store_path / ".git").exists():
|
|
61
|
+
error("Store already initialized")
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
self.store_path.mkdir(parents=True, exist_ok=True)
|
|
65
|
+
|
|
66
|
+
try:
|
|
67
|
+
repo = Repo.init(self.store_path)
|
|
68
|
+
|
|
69
|
+
# Create README
|
|
70
|
+
readme_path = self.store_path / "README.md"
|
|
71
|
+
readme_path.write_text(
|
|
72
|
+
"# MCLI Secrets Store\n\n"
|
|
73
|
+
"This repository stores encrypted secrets for MCLI.\n\n"
|
|
74
|
+
"**WARNING**: This repository contains encrypted sensitive data.\n"
|
|
75
|
+
"Ensure it is kept private and access is restricted.\n"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Create .gitignore
|
|
79
|
+
gitignore_path = self.store_path / ".gitignore"
|
|
80
|
+
gitignore_path.write_text("*.key\n*.tmp\n.DS_Store\n")
|
|
81
|
+
|
|
82
|
+
repo.index.add([readme_path.name, gitignore_path.name])
|
|
83
|
+
repo.index.commit("Initial commit")
|
|
84
|
+
|
|
85
|
+
if remote_url:
|
|
86
|
+
repo.create_remote("origin", remote_url)
|
|
87
|
+
self.store_config["remote_url"] = remote_url
|
|
88
|
+
self.save_config()
|
|
89
|
+
info(f"Remote added: {remote_url}")
|
|
90
|
+
|
|
91
|
+
success(f"Secrets store initialized at {self.store_path}")
|
|
92
|
+
|
|
93
|
+
except GitCommandError as e:
|
|
94
|
+
error(f"Failed to initialize store: {e}")
|
|
95
|
+
|
|
96
|
+
def push(self, secrets_dir: Path, message: Optional[str] = None) -> None:
|
|
97
|
+
"""Push secrets to the store.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
secrets_dir: Directory containing encrypted secrets
|
|
101
|
+
message: Commit message
|
|
102
|
+
"""
|
|
103
|
+
if not self._check_initialized():
|
|
104
|
+
return
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
repo = Repo(self.store_path)
|
|
108
|
+
|
|
109
|
+
# Copy secrets to store
|
|
110
|
+
store_secrets_dir = self.store_path / "secrets"
|
|
111
|
+
|
|
112
|
+
# Remove existing secrets
|
|
113
|
+
if store_secrets_dir.exists():
|
|
114
|
+
shutil.rmtree(store_secrets_dir)
|
|
115
|
+
|
|
116
|
+
# Copy new secrets
|
|
117
|
+
shutil.copytree(secrets_dir, store_secrets_dir)
|
|
118
|
+
|
|
119
|
+
# Add to git
|
|
120
|
+
repo.index.add(["secrets"])
|
|
121
|
+
|
|
122
|
+
# Check if there are changes
|
|
123
|
+
if repo.is_dirty():
|
|
124
|
+
message = message or f"Update secrets from {os.uname().nodename}"
|
|
125
|
+
repo.index.commit(message)
|
|
126
|
+
|
|
127
|
+
# Push if remote exists
|
|
128
|
+
if "origin" in repo.remotes:
|
|
129
|
+
info("Pushing to remote...")
|
|
130
|
+
repo.remotes.origin.push()
|
|
131
|
+
success("Secrets pushed to remote")
|
|
132
|
+
else:
|
|
133
|
+
success("Secrets committed locally")
|
|
134
|
+
else:
|
|
135
|
+
info("No changes to push")
|
|
136
|
+
|
|
137
|
+
except GitCommandError as e:
|
|
138
|
+
error(f"Failed to push secrets: {e}")
|
|
139
|
+
|
|
140
|
+
def pull(self, secrets_dir: Path) -> None:
|
|
141
|
+
"""Pull secrets from the store.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
secrets_dir: Directory to store pulled secrets
|
|
145
|
+
"""
|
|
146
|
+
if not self._check_initialized():
|
|
147
|
+
return
|
|
148
|
+
|
|
149
|
+
try:
|
|
150
|
+
repo = Repo(self.store_path)
|
|
151
|
+
|
|
152
|
+
# Pull from remote if exists
|
|
153
|
+
if "origin" in repo.remotes:
|
|
154
|
+
info("Pulling from remote...")
|
|
155
|
+
repo.remotes.origin.pull()
|
|
156
|
+
|
|
157
|
+
# Copy secrets from store
|
|
158
|
+
store_secrets_dir = self.store_path / "secrets"
|
|
159
|
+
|
|
160
|
+
if not store_secrets_dir.exists():
|
|
161
|
+
warning("No secrets found in store")
|
|
162
|
+
return
|
|
163
|
+
|
|
164
|
+
# Backup existing secrets
|
|
165
|
+
if secrets_dir.exists():
|
|
166
|
+
backup_dir = secrets_dir.parent / f"{secrets_dir.name}.backup"
|
|
167
|
+
if backup_dir.exists():
|
|
168
|
+
shutil.rmtree(backup_dir)
|
|
169
|
+
shutil.move(str(secrets_dir), str(backup_dir))
|
|
170
|
+
info(f"Existing secrets backed up to {backup_dir}")
|
|
171
|
+
|
|
172
|
+
# Copy secrets from store
|
|
173
|
+
shutil.copytree(store_secrets_dir, secrets_dir)
|
|
174
|
+
|
|
175
|
+
success(f"Secrets pulled to {secrets_dir}")
|
|
176
|
+
|
|
177
|
+
except GitCommandError as e:
|
|
178
|
+
error(f"Failed to pull secrets: {e}")
|
|
179
|
+
|
|
180
|
+
def sync(self, secrets_dir: Path, message: Optional[str] = None) -> None:
|
|
181
|
+
"""Synchronize secrets (pull then push).
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
secrets_dir: Directory containing secrets
|
|
185
|
+
message: Commit message
|
|
186
|
+
"""
|
|
187
|
+
if not self._check_initialized():
|
|
188
|
+
return
|
|
189
|
+
|
|
190
|
+
info("Synchronizing secrets...")
|
|
191
|
+
|
|
192
|
+
# First pull
|
|
193
|
+
self.pull(secrets_dir)
|
|
194
|
+
|
|
195
|
+
# Then push
|
|
196
|
+
self.push(secrets_dir, message)
|
|
197
|
+
|
|
198
|
+
def status(self) -> Dict[str, Any]:
|
|
199
|
+
"""Get status of the secrets store.
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
Status information
|
|
203
|
+
"""
|
|
204
|
+
status = {
|
|
205
|
+
"initialized": False,
|
|
206
|
+
"store_path": str(self.store_path),
|
|
207
|
+
"has_remote": False,
|
|
208
|
+
"remote_url": None,
|
|
209
|
+
"clean": True,
|
|
210
|
+
"branch": None,
|
|
211
|
+
"commit": None,
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if not self._check_initialized(silent=True):
|
|
215
|
+
return status
|
|
216
|
+
|
|
217
|
+
try:
|
|
218
|
+
repo = Repo(self.store_path)
|
|
219
|
+
status["initialized"] = True
|
|
220
|
+
status["clean"] = not repo.is_dirty()
|
|
221
|
+
status["branch"] = repo.active_branch.name
|
|
222
|
+
status["commit"] = str(repo.head.commit)[:8]
|
|
223
|
+
|
|
224
|
+
if "origin" in repo.remotes:
|
|
225
|
+
status["has_remote"] = True
|
|
226
|
+
status["remote_url"] = repo.remotes.origin.url
|
|
227
|
+
|
|
228
|
+
except Exception:
|
|
229
|
+
pass
|
|
230
|
+
|
|
231
|
+
return status
|
|
232
|
+
|
|
233
|
+
def _check_initialized(self, silent: bool = False) -> bool:
|
|
234
|
+
"""Check if store is initialized.
|
|
235
|
+
|
|
236
|
+
Args:
|
|
237
|
+
silent: Don't print error message
|
|
238
|
+
|
|
239
|
+
Returns:
|
|
240
|
+
True if initialized
|
|
241
|
+
"""
|
|
242
|
+
if not self.store_path.exists() or not (self.store_path / ".git").exists():
|
|
243
|
+
if not silent:
|
|
244
|
+
error("Store not initialized. Run 'mcli secrets store init' first.")
|
|
245
|
+
return False
|
|
246
|
+
return True
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .toml import read_from_toml
|
|
File without changes
|
mcli/ml/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""MCLI Machine Learning Module for Stock Recommendation System"""
|
|
2
|
+
|
|
3
|
+
from .configs.dvc_config import get_dvc_config, setup_dvc
|
|
4
|
+
from .configs.mlflow_config import get_mlflow_config, setup_mlflow
|
|
5
|
+
from .configs.mlops_manager import MLOpsManager, get_mlops_manager
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"get_mlops_manager",
|
|
11
|
+
"MLOpsManager",
|
|
12
|
+
"get_mlflow_config",
|
|
13
|
+
"setup_mlflow",
|
|
14
|
+
"get_dvc_config",
|
|
15
|
+
"setup_dvc",
|
|
16
|
+
]
|
mcli/ml/api/__init__.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""API routes and endpoints for ML system"""
|
|
2
|
+
|
|
3
|
+
from .app import create_app, get_application
|
|
4
|
+
from .routers import (
|
|
5
|
+
admin_router,
|
|
6
|
+
auth_router,
|
|
7
|
+
backtest_router,
|
|
8
|
+
data_router,
|
|
9
|
+
model_router,
|
|
10
|
+
monitoring_router,
|
|
11
|
+
portfolio_router,
|
|
12
|
+
prediction_router,
|
|
13
|
+
trade_router,
|
|
14
|
+
websocket_router,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"auth_router",
|
|
19
|
+
"model_router",
|
|
20
|
+
"prediction_router",
|
|
21
|
+
"portfolio_router",
|
|
22
|
+
"data_router",
|
|
23
|
+
"trade_router",
|
|
24
|
+
"backtest_router",
|
|
25
|
+
"monitoring_router",
|
|
26
|
+
"admin_router",
|
|
27
|
+
"websocket_router",
|
|
28
|
+
"create_app",
|
|
29
|
+
"get_application",
|
|
30
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""API routers"""
|
|
2
|
+
|
|
3
|
+
from . import (
|
|
4
|
+
admin_router,
|
|
5
|
+
auth_router,
|
|
6
|
+
backtest_router,
|
|
7
|
+
data_router,
|
|
8
|
+
model_router,
|
|
9
|
+
monitoring_router,
|
|
10
|
+
portfolio_router,
|
|
11
|
+
prediction_router,
|
|
12
|
+
trade_router,
|
|
13
|
+
websocket_router,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"auth_router",
|
|
18
|
+
"model_router",
|
|
19
|
+
"prediction_router",
|
|
20
|
+
"portfolio_router",
|
|
21
|
+
"data_router",
|
|
22
|
+
"trade_router",
|
|
23
|
+
"backtest_router",
|
|
24
|
+
"monitoring_router",
|
|
25
|
+
"admin_router",
|
|
26
|
+
"websocket_router",
|
|
27
|
+
]
|
mcli/ml/auth/__init__.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Authentication and authorization system"""
|
|
2
|
+
|
|
3
|
+
from .auth_manager import (
|
|
4
|
+
AuthManager,
|
|
5
|
+
create_access_token,
|
|
6
|
+
get_current_active_user,
|
|
7
|
+
get_current_user,
|
|
8
|
+
hash_password,
|
|
9
|
+
require_role,
|
|
10
|
+
verify_access_token,
|
|
11
|
+
verify_password,
|
|
12
|
+
)
|
|
13
|
+
from .models import (
|
|
14
|
+
PasswordChange,
|
|
15
|
+
PasswordReset,
|
|
16
|
+
TokenResponse,
|
|
17
|
+
UserCreate,
|
|
18
|
+
UserLogin,
|
|
19
|
+
UserResponse,
|
|
20
|
+
)
|
|
21
|
+
from .permissions import Permission, check_permission, has_permission
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"AuthManager",
|
|
25
|
+
"create_access_token",
|
|
26
|
+
"verify_access_token",
|
|
27
|
+
"get_current_user",
|
|
28
|
+
"get_current_active_user",
|
|
29
|
+
"require_role",
|
|
30
|
+
"hash_password",
|
|
31
|
+
"verify_password",
|
|
32
|
+
"UserCreate",
|
|
33
|
+
"UserLogin",
|
|
34
|
+
"UserResponse",
|
|
35
|
+
"TokenResponse",
|
|
36
|
+
"PasswordReset",
|
|
37
|
+
"PasswordChange",
|
|
38
|
+
"Permission",
|
|
39
|
+
"check_permission",
|
|
40
|
+
"has_permission",
|
|
41
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Backtesting framework for trading strategies"""
|
|
2
|
+
|
|
3
|
+
from .backtest_engine import (
|
|
4
|
+
BacktestConfig,
|
|
5
|
+
BacktestEngine,
|
|
6
|
+
BacktestResult,
|
|
7
|
+
PositionManager,
|
|
8
|
+
TradingStrategy,
|
|
9
|
+
)
|
|
10
|
+
from .performance_metrics import (
|
|
11
|
+
PerformanceAnalyzer,
|
|
12
|
+
PortfolioMetrics,
|
|
13
|
+
RiskMetrics,
|
|
14
|
+
plot_performance,
|
|
15
|
+
)
|
|
16
|
+
from .trading_simulator import MarketSimulator, Order, Portfolio, Position, TradingSimulator
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"BacktestEngine",
|
|
20
|
+
"BacktestConfig",
|
|
21
|
+
"BacktestResult",
|
|
22
|
+
"TradingStrategy",
|
|
23
|
+
"PositionManager",
|
|
24
|
+
"PerformanceAnalyzer",
|
|
25
|
+
"PortfolioMetrics",
|
|
26
|
+
"RiskMetrics",
|
|
27
|
+
"plot_performance",
|
|
28
|
+
"TradingSimulator",
|
|
29
|
+
"Order",
|
|
30
|
+
"Position",
|
|
31
|
+
"Portfolio",
|
|
32
|
+
"MarketSimulator",
|
|
33
|
+
]
|
mcli/ml/cli/__init__.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Configuration management for ML system"""
|
|
2
|
+
|
|
3
|
+
from .settings import (
|
|
4
|
+
APISettings,
|
|
5
|
+
DatabaseSettings,
|
|
6
|
+
DataSettings,
|
|
7
|
+
MLflowSettings,
|
|
8
|
+
ModelSettings,
|
|
9
|
+
MonitoringSettings,
|
|
10
|
+
RedisSettings,
|
|
11
|
+
SecuritySettings,
|
|
12
|
+
Settings,
|
|
13
|
+
create_settings,
|
|
14
|
+
get_settings,
|
|
15
|
+
settings,
|
|
16
|
+
update_settings,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"Settings",
|
|
21
|
+
"DatabaseSettings",
|
|
22
|
+
"RedisSettings",
|
|
23
|
+
"MLflowSettings",
|
|
24
|
+
"ModelSettings",
|
|
25
|
+
"DataSettings",
|
|
26
|
+
"APISettings",
|
|
27
|
+
"MonitoringSettings",
|
|
28
|
+
"SecuritySettings",
|
|
29
|
+
"settings",
|
|
30
|
+
"get_settings",
|
|
31
|
+
"update_settings",
|
|
32
|
+
"create_settings",
|
|
33
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""ML Configuration Module"""
|
|
2
|
+
|
|
3
|
+
from .dvc_config import DVCConfig, get_dvc_config, setup_dvc
|
|
4
|
+
from .mlflow_config import MLflowConfig, get_mlflow_config, setup_mlflow
|
|
5
|
+
from .mlops_manager import MLOpsManager, get_mlops_manager
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"MLflowConfig",
|
|
9
|
+
"get_mlflow_config",
|
|
10
|
+
"setup_mlflow",
|
|
11
|
+
"DVCConfig",
|
|
12
|
+
"get_dvc_config",
|
|
13
|
+
"setup_dvc",
|
|
14
|
+
"MLOpsManager",
|
|
15
|
+
"get_mlops_manager",
|
|
16
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Real-time data ingestion pipeline"""
|
|
2
|
+
|
|
3
|
+
from .api_connectors import (
|
|
4
|
+
AlphaVantageConnector,
|
|
5
|
+
CongressionalDataAPI,
|
|
6
|
+
PolygonIOConnector,
|
|
7
|
+
QuiverQuantConnector,
|
|
8
|
+
StockMarketAPI,
|
|
9
|
+
YahooFinanceConnector,
|
|
10
|
+
)
|
|
11
|
+
from .data_pipeline import DataLoader, DataTransformer, DataValidator, IngestionPipeline
|
|
12
|
+
from .stream_processor import DataStream, KafkaConsumer, StreamProcessor, WebSocketConsumer
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"StreamProcessor",
|
|
16
|
+
"DataStream",
|
|
17
|
+
"KafkaConsumer",
|
|
18
|
+
"WebSocketConsumer",
|
|
19
|
+
"CongressionalDataAPI",
|
|
20
|
+
"StockMarketAPI",
|
|
21
|
+
"AlphaVantageConnector",
|
|
22
|
+
"YahooFinanceConnector",
|
|
23
|
+
"PolygonIOConnector",
|
|
24
|
+
"QuiverQuantConnector",
|
|
25
|
+
"IngestionPipeline",
|
|
26
|
+
"DataValidator",
|
|
27
|
+
"DataTransformer",
|
|
28
|
+
"DataLoader",
|
|
29
|
+
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Database models and utilities"""
|
|
2
|
+
|
|
3
|
+
from .models import (
|
|
4
|
+
Alert,
|
|
5
|
+
BacktestResult,
|
|
6
|
+
Base,
|
|
7
|
+
DataVersion,
|
|
8
|
+
Experiment,
|
|
9
|
+
FeatureSet,
|
|
10
|
+
Model,
|
|
11
|
+
Politician,
|
|
12
|
+
Portfolio,
|
|
13
|
+
Prediction,
|
|
14
|
+
StockData,
|
|
15
|
+
Trade,
|
|
16
|
+
User,
|
|
17
|
+
)
|
|
18
|
+
from .session import AsyncSessionLocal, SessionLocal, async_engine, engine, get_async_db, get_db
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"Base",
|
|
22
|
+
"User",
|
|
23
|
+
"Trade",
|
|
24
|
+
"Politician",
|
|
25
|
+
"StockData",
|
|
26
|
+
"Prediction",
|
|
27
|
+
"Portfolio",
|
|
28
|
+
"Alert",
|
|
29
|
+
"BacktestResult",
|
|
30
|
+
"Experiment",
|
|
31
|
+
"Model",
|
|
32
|
+
"FeatureSet",
|
|
33
|
+
"DataVersion",
|
|
34
|
+
"get_db",
|
|
35
|
+
"get_async_db",
|
|
36
|
+
"SessionLocal",
|
|
37
|
+
"AsyncSessionLocal",
|
|
38
|
+
"engine",
|
|
39
|
+
"async_engine",
|
|
40
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""ML Experimentation and A/B Testing Framework"""
|
|
2
|
+
|
|
3
|
+
from .ab_testing import (
|
|
4
|
+
ABTestingFramework,
|
|
5
|
+
ExperimentConfig,
|
|
6
|
+
ExperimentResult,
|
|
7
|
+
ExperimentStatus,
|
|
8
|
+
Metric,
|
|
9
|
+
MetricsCollector,
|
|
10
|
+
StatisticalAnalyzer,
|
|
11
|
+
TrafficSplitter,
|
|
12
|
+
UserAssignment,
|
|
13
|
+
Variant,
|
|
14
|
+
VariantType,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"ABTestingFramework",
|
|
19
|
+
"ExperimentConfig",
|
|
20
|
+
"Variant",
|
|
21
|
+
"VariantType",
|
|
22
|
+
"Metric",
|
|
23
|
+
"ExperimentStatus",
|
|
24
|
+
"ExperimentResult",
|
|
25
|
+
"UserAssignment",
|
|
26
|
+
"TrafficSplitter",
|
|
27
|
+
"MetricsCollector",
|
|
28
|
+
"StatisticalAnalyzer",
|
|
29
|
+
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Feature Engineering Module for Stock Recommendation Models"""
|
|
2
|
+
|
|
3
|
+
from .ensemble_features import (
|
|
4
|
+
DynamicFeatureSelector,
|
|
5
|
+
EnsembleFeatureBuilder,
|
|
6
|
+
FeatureInteractionEngine,
|
|
7
|
+
)
|
|
8
|
+
from .political_features import (
|
|
9
|
+
CongressionalTrackingFeatures,
|
|
10
|
+
PolicyImpactFeatures,
|
|
11
|
+
PoliticalInfluenceFeatures,
|
|
12
|
+
)
|
|
13
|
+
from .recommendation_engine import (
|
|
14
|
+
RecommendationConfig,
|
|
15
|
+
RecommendationResult,
|
|
16
|
+
StockRecommendationEngine,
|
|
17
|
+
)
|
|
18
|
+
from .stock_features import (
|
|
19
|
+
CrossAssetFeatures,
|
|
20
|
+
MarketRegimeFeatures,
|
|
21
|
+
StockRecommendationFeatures,
|
|
22
|
+
TechnicalIndicatorFeatures,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"StockRecommendationFeatures",
|
|
27
|
+
"TechnicalIndicatorFeatures",
|
|
28
|
+
"MarketRegimeFeatures",
|
|
29
|
+
"CrossAssetFeatures",
|
|
30
|
+
"PoliticalInfluenceFeatures",
|
|
31
|
+
"CongressionalTrackingFeatures",
|
|
32
|
+
"PolicyImpactFeatures",
|
|
33
|
+
"EnsembleFeatureBuilder",
|
|
34
|
+
"FeatureInteractionEngine",
|
|
35
|
+
"DynamicFeatureSelector",
|
|
36
|
+
"StockRecommendationEngine",
|
|
37
|
+
"RecommendationConfig",
|
|
38
|
+
"RecommendationResult",
|
|
39
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""MLOps components for ML pipeline management"""
|
|
2
|
+
|
|
3
|
+
from .experiment_tracker import ExperimentRun, ExperimentTracker, MLflowConfig, ModelRegistry
|
|
4
|
+
from .model_serving import ModelEndpoint, ModelServer, PredictionService
|
|
5
|
+
from .pipeline_orchestrator import MLPipeline, PipelineConfig, PipelineExecutor, PipelineStep
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"ExperimentTracker",
|
|
9
|
+
"ModelRegistry",
|
|
10
|
+
"MLflowConfig",
|
|
11
|
+
"ExperimentRun",
|
|
12
|
+
"ModelServer",
|
|
13
|
+
"PredictionService",
|
|
14
|
+
"ModelEndpoint",
|
|
15
|
+
"MLPipeline",
|
|
16
|
+
"PipelineStep",
|
|
17
|
+
"PipelineConfig",
|
|
18
|
+
"PipelineExecutor",
|
|
19
|
+
]
|