mcli-framework 7.1.0__py3-none-any.whl → 7.1.2__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/app/completion_cmd.py +59 -49
- mcli/app/completion_helpers.py +60 -138
- mcli/app/logs_cmd.py +46 -13
- mcli/app/main.py +17 -14
- mcli/app/model_cmd.py +19 -4
- mcli/chat/chat.py +3 -2
- mcli/lib/search/cached_vectorizer.py +1 -0
- mcli/lib/services/data_pipeline.py +12 -5
- mcli/lib/services/lsh_client.py +69 -58
- mcli/ml/api/app.py +28 -36
- mcli/ml/api/middleware.py +8 -16
- mcli/ml/api/routers/admin_router.py +3 -1
- mcli/ml/api/routers/auth_router.py +32 -56
- mcli/ml/api/routers/backtest_router.py +3 -1
- mcli/ml/api/routers/data_router.py +3 -1
- mcli/ml/api/routers/model_router.py +35 -74
- mcli/ml/api/routers/monitoring_router.py +3 -1
- mcli/ml/api/routers/portfolio_router.py +3 -1
- mcli/ml/api/routers/prediction_router.py +60 -65
- mcli/ml/api/routers/trade_router.py +6 -2
- mcli/ml/api/routers/websocket_router.py +12 -9
- mcli/ml/api/schemas.py +10 -2
- mcli/ml/auth/auth_manager.py +49 -114
- mcli/ml/auth/models.py +30 -15
- mcli/ml/auth/permissions.py +12 -19
- mcli/ml/backtesting/backtest_engine.py +134 -108
- mcli/ml/backtesting/performance_metrics.py +142 -108
- mcli/ml/cache.py +12 -18
- mcli/ml/cli/main.py +37 -23
- mcli/ml/config/settings.py +29 -12
- mcli/ml/dashboard/app.py +122 -130
- mcli/ml/dashboard/app_integrated.py +283 -152
- mcli/ml/dashboard/app_supabase.py +176 -108
- mcli/ml/dashboard/app_training.py +212 -206
- mcli/ml/dashboard/cli.py +14 -5
- mcli/ml/data_ingestion/api_connectors.py +51 -81
- mcli/ml/data_ingestion/data_pipeline.py +127 -125
- mcli/ml/data_ingestion/stream_processor.py +72 -80
- mcli/ml/database/migrations/env.py +3 -2
- mcli/ml/database/models.py +112 -79
- mcli/ml/database/session.py +6 -5
- mcli/ml/experimentation/ab_testing.py +149 -99
- mcli/ml/features/ensemble_features.py +9 -8
- mcli/ml/features/political_features.py +6 -5
- mcli/ml/features/recommendation_engine.py +15 -14
- mcli/ml/features/stock_features.py +7 -6
- mcli/ml/features/test_feature_engineering.py +8 -7
- mcli/ml/logging.py +10 -15
- mcli/ml/mlops/data_versioning.py +57 -64
- mcli/ml/mlops/experiment_tracker.py +49 -41
- mcli/ml/mlops/model_serving.py +59 -62
- mcli/ml/mlops/pipeline_orchestrator.py +203 -149
- mcli/ml/models/base_models.py +8 -7
- mcli/ml/models/ensemble_models.py +6 -5
- mcli/ml/models/recommendation_models.py +7 -6
- mcli/ml/models/test_models.py +18 -14
- mcli/ml/monitoring/drift_detection.py +95 -74
- mcli/ml/monitoring/metrics.py +10 -22
- mcli/ml/optimization/portfolio_optimizer.py +172 -132
- mcli/ml/predictions/prediction_engine.py +235 -0
- mcli/ml/preprocessing/data_cleaners.py +6 -5
- mcli/ml/preprocessing/feature_extractors.py +7 -6
- mcli/ml/preprocessing/ml_pipeline.py +3 -2
- mcli/ml/preprocessing/politician_trading_preprocessor.py +11 -10
- mcli/ml/preprocessing/test_preprocessing.py +4 -4
- mcli/ml/scripts/populate_sample_data.py +36 -16
- mcli/ml/tasks.py +82 -83
- mcli/ml/tests/test_integration.py +86 -76
- mcli/ml/tests/test_training_dashboard.py +169 -142
- mcli/mygroup/test_cmd.py +2 -1
- mcli/self/self_cmd.py +38 -18
- mcli/self/test_cmd.py +2 -1
- mcli/workflow/dashboard/dashboard_cmd.py +13 -6
- mcli/workflow/lsh_integration.py +46 -58
- mcli/workflow/politician_trading/commands.py +576 -427
- mcli/workflow/politician_trading/config.py +7 -7
- mcli/workflow/politician_trading/connectivity.py +35 -33
- mcli/workflow/politician_trading/data_sources.py +72 -71
- mcli/workflow/politician_trading/database.py +18 -16
- mcli/workflow/politician_trading/demo.py +4 -3
- mcli/workflow/politician_trading/models.py +5 -5
- mcli/workflow/politician_trading/monitoring.py +13 -13
- mcli/workflow/politician_trading/scrapers.py +332 -224
- mcli/workflow/politician_trading/scrapers_california.py +116 -94
- mcli/workflow/politician_trading/scrapers_eu.py +70 -71
- mcli/workflow/politician_trading/scrapers_uk.py +118 -90
- mcli/workflow/politician_trading/scrapers_us_states.py +125 -92
- mcli/workflow/politician_trading/workflow.py +98 -71
- {mcli_framework-7.1.0.dist-info → mcli_framework-7.1.2.dist-info}/METADATA +2 -2
- {mcli_framework-7.1.0.dist-info → mcli_framework-7.1.2.dist-info}/RECORD +94 -93
- {mcli_framework-7.1.0.dist-info → mcli_framework-7.1.2.dist-info}/WHEEL +0 -0
- {mcli_framework-7.1.0.dist-info → mcli_framework-7.1.2.dist-info}/entry_points.txt +0 -0
- {mcli_framework-7.1.0.dist-info → mcli_framework-7.1.2.dist-info}/licenses/LICENSE +0 -0
- {mcli_framework-7.1.0.dist-info → mcli_framework-7.1.2.dist-info}/top_level.txt +0 -0
|
@@ -4,9 +4,9 @@ Data models for politician trading information
|
|
|
4
4
|
|
|
5
5
|
from dataclasses import dataclass, field
|
|
6
6
|
from datetime import datetime
|
|
7
|
-
from enum import Enum
|
|
8
|
-
from typing import List, Optional, Dict, Any
|
|
9
7
|
from decimal import Decimal
|
|
8
|
+
from enum import Enum
|
|
9
|
+
from typing import Any, Dict, List, Optional
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class PoliticianRole(Enum):
|
|
@@ -18,15 +18,15 @@ class PoliticianRole(Enum):
|
|
|
18
18
|
EU_MEP = "eu_parliament_member"
|
|
19
19
|
EU_COMMISSIONER = "eu_commissioner"
|
|
20
20
|
EU_COUNCIL_MEMBER = "eu_council_member"
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
# EU Member State Roles
|
|
23
23
|
GERMAN_BUNDESTAG = "german_bundestag_member"
|
|
24
24
|
FRENCH_DEPUTY = "french_national_assembly_deputy"
|
|
25
25
|
ITALIAN_DEPUTY = "italian_chamber_deputy"
|
|
26
26
|
ITALIAN_SENATOR = "italian_senate_member"
|
|
27
|
-
SPANISH_DEPUTY = "spanish_congress_deputy"
|
|
27
|
+
SPANISH_DEPUTY = "spanish_congress_deputy"
|
|
28
28
|
DUTCH_MP = "dutch_tweede_kamer_member"
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
# US State Roles
|
|
31
31
|
TEXAS_STATE_OFFICIAL = "texas_state_official"
|
|
32
32
|
NEW_YORK_STATE_OFFICIAL = "new_york_state_official"
|
|
@@ -5,15 +5,15 @@ Monitoring and status reporting for politician trading data collection
|
|
|
5
5
|
import asyncio
|
|
6
6
|
import logging
|
|
7
7
|
from datetime import datetime, timedelta, timezone
|
|
8
|
-
from typing import Dict, List,
|
|
8
|
+
from typing import Any, Dict, List, Optional
|
|
9
9
|
|
|
10
10
|
from rich.console import Console
|
|
11
|
-
from rich.table import Table
|
|
12
11
|
from rich.panel import Panel
|
|
13
12
|
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
13
|
+
from rich.table import Table
|
|
14
14
|
|
|
15
|
-
from .database import PoliticianTradingDB
|
|
16
15
|
from .config import WorkflowConfig
|
|
16
|
+
from .database import PoliticianTradingDB
|
|
17
17
|
|
|
18
18
|
logger = logging.getLogger(__name__)
|
|
19
19
|
console = Console()
|
|
@@ -203,9 +203,7 @@ class PoliticianTradingMonitor:
|
|
|
203
203
|
# Get total counts
|
|
204
204
|
politicians_result = self.db.client.table("politicians").select("id").execute()
|
|
205
205
|
|
|
206
|
-
disclosures_result = (
|
|
207
|
-
self.db.client.table("trading_disclosures").select("id").execute()
|
|
208
|
-
)
|
|
206
|
+
disclosures_result = self.db.client.table("trading_disclosures").select("id").execute()
|
|
209
207
|
|
|
210
208
|
jobs_result = self.db.client.table("data_pull_jobs").select("id").execute()
|
|
211
209
|
|
|
@@ -218,10 +216,7 @@ class PoliticianTradingMonitor:
|
|
|
218
216
|
)
|
|
219
217
|
|
|
220
218
|
eu_politicians = (
|
|
221
|
-
self.db.client.table("politicians")
|
|
222
|
-
.select("id")
|
|
223
|
-
.eq("role", "eu_mep")
|
|
224
|
-
.execute()
|
|
219
|
+
self.db.client.table("politicians").select("id").eq("role", "eu_mep").execute()
|
|
225
220
|
)
|
|
226
221
|
|
|
227
222
|
# Get recent activity (last 30 days)
|
|
@@ -253,7 +248,9 @@ class PoliticianTradingMonitor:
|
|
|
253
248
|
"eu_total": len(eu_politicians.data) if eu_politicians.data else 0,
|
|
254
249
|
},
|
|
255
250
|
"recent_activity": {
|
|
256
|
-
"disclosures_last_30_days":
|
|
251
|
+
"disclosures_last_30_days": (
|
|
252
|
+
len(recent_disclosures.data) if recent_disclosures.data else 0
|
|
253
|
+
)
|
|
257
254
|
},
|
|
258
255
|
"top_assets": top_assets.data if top_assets.data else [],
|
|
259
256
|
"generated_at": datetime.utcnow().isoformat(),
|
|
@@ -369,8 +366,11 @@ class PoliticianTradingMonitor:
|
|
|
369
366
|
|
|
370
367
|
# Group by asset ticker to count occurrences
|
|
371
368
|
from collections import Counter
|
|
372
|
-
|
|
373
|
-
|
|
369
|
+
|
|
370
|
+
asset_counts = Counter(
|
|
371
|
+
asset.get("asset_ticker", "Unknown") for asset in stats["top_assets"]
|
|
372
|
+
)
|
|
373
|
+
|
|
374
374
|
for asset_ticker, count in asset_counts.most_common(5): # Top 5
|
|
375
375
|
assets_table.add_row(asset_ticker)
|
|
376
376
|
|