mcli-framework 7.2.0__py3-none-any.whl → 7.4.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/commands_cmd.py +741 -0
- mcli/app/model/__init__.py +0 -0
- 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/logger/__init__.py +3 -0
- mcli/lib/performance/__init__.py +17 -0
- mcli/lib/pickles/__init__.py +1 -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/api/schemas.py +2 -2
- mcli/ml/auth/__init__.py +45 -0
- mcli/ml/auth/models.py +2 -2
- mcli/ml/backtesting/__init__.py +39 -0
- mcli/ml/cli/__init__.py +5 -0
- mcli/ml/cli/main.py +1 -1
- mcli/ml/config/__init__.py +33 -0
- mcli/ml/configs/__init__.py +16 -0
- mcli/ml/dashboard/__init__.py +12 -0
- mcli/ml/dashboard/app_integrated.py +296 -30
- mcli/ml/dashboard/app_training.py +1 -1
- mcli/ml/dashboard/components/__init__.py +7 -0
- mcli/ml/dashboard/pages/__init__.py +6 -0
- mcli/ml/dashboard/pages/cicd.py +1 -1
- mcli/ml/dashboard/pages/debug_dependencies.py +364 -0
- mcli/ml/dashboard/pages/gravity_viz.py +565 -0
- mcli/ml/dashboard/pages/monte_carlo_predictions.py +555 -0
- mcli/ml/dashboard/pages/overview.py +378 -0
- mcli/ml/dashboard/pages/predictions_enhanced.py +20 -6
- mcli/ml/dashboard/pages/scrapers_and_logs.py +22 -6
- mcli/ml/dashboard/pages/test_portfolio.py +423 -0
- mcli/ml/dashboard/pages/trading.py +768 -0
- mcli/ml/dashboard/streamlit_extras_utils.py +297 -0
- mcli/ml/dashboard/utils.py +161 -0
- mcli/ml/dashboard/warning_suppression.py +34 -0
- mcli/ml/data_ingestion/__init__.py +39 -0
- mcli/ml/database/__init__.py +47 -0
- mcli/ml/database/session.py +169 -16
- mcli/ml/experimentation/__init__.py +29 -0
- mcli/ml/features/__init__.py +39 -0
- mcli/ml/mlops/__init__.py +33 -0
- mcli/ml/models/__init__.py +94 -0
- mcli/ml/monitoring/__init__.py +25 -0
- mcli/ml/optimization/__init__.py +27 -0
- mcli/ml/predictions/__init__.py +5 -0
- mcli/ml/predictions/monte_carlo.py +428 -0
- mcli/ml/preprocessing/__init__.py +28 -0
- mcli/ml/scripts/__init__.py +1 -0
- mcli/ml/trading/__init__.py +66 -0
- mcli/ml/trading/alpaca_client.py +417 -0
- mcli/ml/trading/migrations.py +164 -0
- mcli/ml/trading/models.py +418 -0
- mcli/ml/trading/paper_trading.py +326 -0
- mcli/ml/trading/risk_management.py +370 -0
- mcli/ml/trading/trading_service.py +480 -0
- mcli/ml/training/__init__.py +10 -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 +514 -15
- mcli/workflow/__init__.py +0 -0
- mcli/workflow/daemon/__init__.py +15 -0
- mcli/workflow/daemon/daemon.py +21 -3
- 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.2.0.dist-info → mcli_framework-7.4.0.dist-info}/METADATA +4 -1
- {mcli_framework-7.2.0.dist-info → mcli_framework-7.4.0.dist-info}/RECORD +97 -18
- {mcli_framework-7.2.0.dist-info → mcli_framework-7.4.0.dist-info}/WHEEL +0 -0
- {mcli_framework-7.2.0.dist-info → mcli_framework-7.4.0.dist-info}/entry_points.txt +0 -0
- {mcli_framework-7.2.0.dist-info → mcli_framework-7.4.0.dist-info}/licenses/LICENSE +0 -0
- {mcli_framework-7.2.0.dist-info → mcli_framework-7.4.0.dist-info}/top_level.txt +0 -0
|
File without changes
|
mcli/chat/__init__.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MCLI Chat System
|
|
3
|
+
Real-time system control and interaction capabilities for MCLI chat
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .system_controller import (
|
|
7
|
+
SystemController,
|
|
8
|
+
control_app,
|
|
9
|
+
execute_system_command,
|
|
10
|
+
open_file_or_url,
|
|
11
|
+
open_textedit_and_write,
|
|
12
|
+
system_controller,
|
|
13
|
+
take_screenshot,
|
|
14
|
+
)
|
|
15
|
+
from .system_integration import (
|
|
16
|
+
ChatSystemIntegration,
|
|
17
|
+
chat_system_integration,
|
|
18
|
+
get_system_capabilities,
|
|
19
|
+
handle_system_request,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
"SystemController",
|
|
24
|
+
"system_controller",
|
|
25
|
+
"ChatSystemIntegration",
|
|
26
|
+
"chat_system_integration",
|
|
27
|
+
"handle_system_request",
|
|
28
|
+
"get_system_capabilities",
|
|
29
|
+
"open_textedit_and_write",
|
|
30
|
+
"control_app",
|
|
31
|
+
"execute_system_command",
|
|
32
|
+
"take_screenshot",
|
|
33
|
+
"open_file_or_url",
|
|
34
|
+
]
|
mcli/lib/__init__.py
ADDED
|
File without changes
|
mcli/lib/api/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .auth import *
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .config import *
|
mcli/lib/erd/__init__.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Entity Relationship Diagram (ERD) package.
|
|
3
|
+
|
|
4
|
+
This package provides utilities for generating Entity Relationship Diagrams from MCLI type metadata.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Import and export all public functions from erd.py
|
|
8
|
+
from .erd import (
|
|
9
|
+
analyze_graph_for_hierarchical_exports,
|
|
10
|
+
create_merged_erd,
|
|
11
|
+
do_erd,
|
|
12
|
+
find_top_nodes_in_graph,
|
|
13
|
+
generate_erd_for_top_nodes,
|
|
14
|
+
generate_merged_erd_for_types,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# Define __all__ to control exports
|
|
18
|
+
__all__ = [
|
|
19
|
+
"do_erd",
|
|
20
|
+
"create_merged_erd",
|
|
21
|
+
"generate_merged_erd_for_types",
|
|
22
|
+
"find_top_nodes_in_graph",
|
|
23
|
+
"generate_erd_for_top_nodes",
|
|
24
|
+
"analyze_graph_for_hierarchical_exports",
|
|
25
|
+
]
|
|
File without changes
|
mcli/lib/fs/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .fs import *
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Performance optimization utilities for mcli
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .uvloop_config import (
|
|
6
|
+
configure_event_loop_for_performance,
|
|
7
|
+
get_event_loop_info,
|
|
8
|
+
install_uvloop,
|
|
9
|
+
should_use_uvloop,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"install_uvloop",
|
|
14
|
+
"should_use_uvloop",
|
|
15
|
+
"get_event_loop_info",
|
|
16
|
+
"configure_event_loop_for_performance",
|
|
17
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .pickles import ObjectCache
|
|
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/api/schemas.py
CHANGED
|
@@ -32,7 +32,7 @@ class ModelResponse(BaseModel):
|
|
|
32
32
|
updated_at: datetime
|
|
33
33
|
|
|
34
34
|
class Config:
|
|
35
|
-
|
|
35
|
+
from_attributes = True
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
class ModelMetrics(BaseModel):
|
|
@@ -69,4 +69,4 @@ class PredictionResponse(BaseModel):
|
|
|
69
69
|
model_name: str
|
|
70
70
|
|
|
71
71
|
class Config:
|
|
72
|
-
|
|
72
|
+
from_attributes = True
|
mcli/ml/auth/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
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 (
|
|
22
|
+
Permission,
|
|
23
|
+
check_permission,
|
|
24
|
+
has_permission,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"AuthManager",
|
|
29
|
+
"create_access_token",
|
|
30
|
+
"verify_access_token",
|
|
31
|
+
"get_current_user",
|
|
32
|
+
"get_current_active_user",
|
|
33
|
+
"require_role",
|
|
34
|
+
"hash_password",
|
|
35
|
+
"verify_password",
|
|
36
|
+
"UserCreate",
|
|
37
|
+
"UserLogin",
|
|
38
|
+
"UserResponse",
|
|
39
|
+
"TokenResponse",
|
|
40
|
+
"PasswordReset",
|
|
41
|
+
"PasswordChange",
|
|
42
|
+
"Permission",
|
|
43
|
+
"check_permission",
|
|
44
|
+
"has_permission",
|
|
45
|
+
]
|
mcli/ml/auth/models.py
CHANGED
|
@@ -10,7 +10,7 @@ from pydantic import BaseModel, EmailStr, Field, validator
|
|
|
10
10
|
class UserCreate(BaseModel):
|
|
11
11
|
"""User registration model"""
|
|
12
12
|
|
|
13
|
-
username: str = Field(..., min_length=3, max_length=50,
|
|
13
|
+
username: str = Field(..., min_length=3, max_length=50, pattern="^[a-zA-Z0-9_-]+$")
|
|
14
14
|
email: EmailStr
|
|
15
15
|
password: str = Field(..., min_length=8, max_length=100)
|
|
16
16
|
first_name: Optional[str] = Field(None, max_length=50)
|
|
@@ -52,7 +52,7 @@ class UserResponse(BaseModel):
|
|
|
52
52
|
last_login_at: Optional[datetime]
|
|
53
53
|
|
|
54
54
|
class Config:
|
|
55
|
-
|
|
55
|
+
from_attributes = True
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
class TokenResponse(BaseModel):
|
|
@@ -0,0 +1,39 @@
|
|
|
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 (
|
|
17
|
+
MarketSimulator,
|
|
18
|
+
Order,
|
|
19
|
+
Portfolio,
|
|
20
|
+
Position,
|
|
21
|
+
TradingSimulator,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"BacktestEngine",
|
|
26
|
+
"BacktestConfig",
|
|
27
|
+
"BacktestResult",
|
|
28
|
+
"TradingStrategy",
|
|
29
|
+
"PositionManager",
|
|
30
|
+
"PerformanceAnalyzer",
|
|
31
|
+
"PortfolioMetrics",
|
|
32
|
+
"RiskMetrics",
|
|
33
|
+
"plot_performance",
|
|
34
|
+
"TradingSimulator",
|
|
35
|
+
"Order",
|
|
36
|
+
"Position",
|
|
37
|
+
"Portfolio",
|
|
38
|
+
"MarketSimulator",
|
|
39
|
+
]
|
mcli/ml/cli/__init__.py
ADDED
mcli/ml/cli/main.py
CHANGED
|
@@ -377,6 +377,7 @@ def config(
|
|
|
377
377
|
debug: Optional[bool] = typer.Option(None, "--debug", help="Set debug mode"),
|
|
378
378
|
):
|
|
379
379
|
"""Manage system configuration"""
|
|
380
|
+
global settings
|
|
380
381
|
|
|
381
382
|
if show:
|
|
382
383
|
console.print(f"[bold blue]Current Configuration[/bold blue]")
|
|
@@ -399,7 +400,6 @@ def config(
|
|
|
399
400
|
raise typer.Exit(1)
|
|
400
401
|
|
|
401
402
|
# Update environment
|
|
402
|
-
global settings
|
|
403
403
|
settings = create_settings(environment)
|
|
404
404
|
console.print(f"[green]✓ Environment set to: {environment}[/green]")
|
|
405
405
|
|
|
@@ -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
|
+
]
|