mcli-framework 7.0.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/app/chat_cmd.py +42 -0
- mcli/app/commands_cmd.py +226 -0
- mcli/app/completion_cmd.py +216 -0
- mcli/app/completion_helpers.py +288 -0
- mcli/app/cron_test_cmd.py +697 -0
- mcli/app/logs_cmd.py +419 -0
- mcli/app/main.py +492 -0
- mcli/app/model/model.py +1060 -0
- mcli/app/model_cmd.py +227 -0
- mcli/app/redis_cmd.py +269 -0
- mcli/app/video/video.py +1114 -0
- mcli/app/visual_cmd.py +303 -0
- mcli/chat/chat.py +2409 -0
- mcli/chat/command_rag.py +514 -0
- mcli/chat/enhanced_chat.py +652 -0
- mcli/chat/system_controller.py +1010 -0
- mcli/chat/system_integration.py +1016 -0
- mcli/cli.py +25 -0
- mcli/config.toml +20 -0
- mcli/lib/api/api.py +586 -0
- mcli/lib/api/daemon_client.py +203 -0
- mcli/lib/api/daemon_client_local.py +44 -0
- mcli/lib/api/daemon_decorator.py +217 -0
- mcli/lib/api/mcli_decorators.py +1032 -0
- mcli/lib/auth/auth.py +85 -0
- mcli/lib/auth/aws_manager.py +85 -0
- mcli/lib/auth/azure_manager.py +91 -0
- mcli/lib/auth/credential_manager.py +192 -0
- mcli/lib/auth/gcp_manager.py +93 -0
- mcli/lib/auth/key_manager.py +117 -0
- mcli/lib/auth/mcli_manager.py +93 -0
- mcli/lib/auth/token_manager.py +75 -0
- mcli/lib/auth/token_util.py +1011 -0
- mcli/lib/config/config.py +47 -0
- mcli/lib/discovery/__init__.py +1 -0
- mcli/lib/discovery/command_discovery.py +274 -0
- mcli/lib/erd/erd.py +1345 -0
- mcli/lib/erd/generate_graph.py +453 -0
- mcli/lib/files/files.py +76 -0
- mcli/lib/fs/fs.py +109 -0
- mcli/lib/lib.py +29 -0
- mcli/lib/logger/logger.py +611 -0
- mcli/lib/performance/optimizer.py +409 -0
- mcli/lib/performance/rust_bridge.py +502 -0
- mcli/lib/performance/uvloop_config.py +154 -0
- mcli/lib/pickles/pickles.py +50 -0
- mcli/lib/search/cached_vectorizer.py +479 -0
- mcli/lib/services/data_pipeline.py +460 -0
- mcli/lib/services/lsh_client.py +441 -0
- mcli/lib/services/redis_service.py +387 -0
- mcli/lib/shell/shell.py +137 -0
- mcli/lib/toml/toml.py +33 -0
- mcli/lib/ui/styling.py +47 -0
- mcli/lib/ui/visual_effects.py +634 -0
- mcli/lib/watcher/watcher.py +185 -0
- mcli/ml/api/app.py +215 -0
- mcli/ml/api/middleware.py +224 -0
- mcli/ml/api/routers/admin_router.py +12 -0
- mcli/ml/api/routers/auth_router.py +244 -0
- mcli/ml/api/routers/backtest_router.py +12 -0
- mcli/ml/api/routers/data_router.py +12 -0
- mcli/ml/api/routers/model_router.py +302 -0
- mcli/ml/api/routers/monitoring_router.py +12 -0
- mcli/ml/api/routers/portfolio_router.py +12 -0
- mcli/ml/api/routers/prediction_router.py +267 -0
- mcli/ml/api/routers/trade_router.py +12 -0
- mcli/ml/api/routers/websocket_router.py +76 -0
- mcli/ml/api/schemas.py +64 -0
- mcli/ml/auth/auth_manager.py +425 -0
- mcli/ml/auth/models.py +154 -0
- mcli/ml/auth/permissions.py +302 -0
- mcli/ml/backtesting/backtest_engine.py +502 -0
- mcli/ml/backtesting/performance_metrics.py +393 -0
- mcli/ml/cache.py +400 -0
- mcli/ml/cli/main.py +398 -0
- mcli/ml/config/settings.py +394 -0
- mcli/ml/configs/dvc_config.py +230 -0
- mcli/ml/configs/mlflow_config.py +131 -0
- mcli/ml/configs/mlops_manager.py +293 -0
- mcli/ml/dashboard/app.py +532 -0
- mcli/ml/dashboard/app_integrated.py +738 -0
- mcli/ml/dashboard/app_supabase.py +560 -0
- mcli/ml/dashboard/app_training.py +615 -0
- mcli/ml/dashboard/cli.py +51 -0
- mcli/ml/data_ingestion/api_connectors.py +501 -0
- mcli/ml/data_ingestion/data_pipeline.py +567 -0
- mcli/ml/data_ingestion/stream_processor.py +512 -0
- mcli/ml/database/migrations/env.py +94 -0
- mcli/ml/database/models.py +667 -0
- mcli/ml/database/session.py +200 -0
- mcli/ml/experimentation/ab_testing.py +845 -0
- mcli/ml/features/ensemble_features.py +607 -0
- mcli/ml/features/political_features.py +676 -0
- mcli/ml/features/recommendation_engine.py +809 -0
- mcli/ml/features/stock_features.py +573 -0
- mcli/ml/features/test_feature_engineering.py +346 -0
- mcli/ml/logging.py +85 -0
- mcli/ml/mlops/data_versioning.py +518 -0
- mcli/ml/mlops/experiment_tracker.py +377 -0
- mcli/ml/mlops/model_serving.py +481 -0
- mcli/ml/mlops/pipeline_orchestrator.py +614 -0
- mcli/ml/models/base_models.py +324 -0
- mcli/ml/models/ensemble_models.py +675 -0
- mcli/ml/models/recommendation_models.py +474 -0
- mcli/ml/models/test_models.py +487 -0
- mcli/ml/monitoring/drift_detection.py +676 -0
- mcli/ml/monitoring/metrics.py +45 -0
- mcli/ml/optimization/portfolio_optimizer.py +834 -0
- mcli/ml/preprocessing/data_cleaners.py +451 -0
- mcli/ml/preprocessing/feature_extractors.py +491 -0
- mcli/ml/preprocessing/ml_pipeline.py +382 -0
- mcli/ml/preprocessing/politician_trading_preprocessor.py +569 -0
- mcli/ml/preprocessing/test_preprocessing.py +294 -0
- mcli/ml/scripts/populate_sample_data.py +200 -0
- mcli/ml/tasks.py +400 -0
- mcli/ml/tests/test_integration.py +429 -0
- mcli/ml/tests/test_training_dashboard.py +387 -0
- mcli/public/oi/oi.py +15 -0
- mcli/public/public.py +4 -0
- mcli/self/self_cmd.py +1246 -0
- mcli/workflow/daemon/api_daemon.py +800 -0
- mcli/workflow/daemon/async_command_database.py +681 -0
- mcli/workflow/daemon/async_process_manager.py +591 -0
- mcli/workflow/daemon/client.py +530 -0
- mcli/workflow/daemon/commands.py +1196 -0
- mcli/workflow/daemon/daemon.py +905 -0
- mcli/workflow/daemon/daemon_api.py +59 -0
- mcli/workflow/daemon/enhanced_daemon.py +571 -0
- mcli/workflow/daemon/process_cli.py +244 -0
- mcli/workflow/daemon/process_manager.py +439 -0
- mcli/workflow/daemon/test_daemon.py +275 -0
- mcli/workflow/dashboard/dashboard_cmd.py +113 -0
- mcli/workflow/docker/docker.py +0 -0
- mcli/workflow/file/file.py +100 -0
- mcli/workflow/gcloud/config.toml +21 -0
- mcli/workflow/gcloud/gcloud.py +58 -0
- mcli/workflow/git_commit/ai_service.py +328 -0
- mcli/workflow/git_commit/commands.py +430 -0
- mcli/workflow/lsh_integration.py +355 -0
- mcli/workflow/model_service/client.py +594 -0
- mcli/workflow/model_service/download_and_run_efficient_models.py +288 -0
- mcli/workflow/model_service/lightweight_embedder.py +397 -0
- mcli/workflow/model_service/lightweight_model_server.py +714 -0
- mcli/workflow/model_service/lightweight_test.py +241 -0
- mcli/workflow/model_service/model_service.py +1955 -0
- mcli/workflow/model_service/ollama_efficient_runner.py +425 -0
- mcli/workflow/model_service/pdf_processor.py +386 -0
- mcli/workflow/model_service/test_efficient_runner.py +234 -0
- mcli/workflow/model_service/test_example.py +315 -0
- mcli/workflow/model_service/test_integration.py +131 -0
- mcli/workflow/model_service/test_new_features.py +149 -0
- mcli/workflow/openai/openai.py +99 -0
- mcli/workflow/politician_trading/commands.py +1790 -0
- mcli/workflow/politician_trading/config.py +134 -0
- mcli/workflow/politician_trading/connectivity.py +490 -0
- mcli/workflow/politician_trading/data_sources.py +395 -0
- mcli/workflow/politician_trading/database.py +410 -0
- mcli/workflow/politician_trading/demo.py +248 -0
- mcli/workflow/politician_trading/models.py +165 -0
- mcli/workflow/politician_trading/monitoring.py +413 -0
- mcli/workflow/politician_trading/scrapers.py +966 -0
- mcli/workflow/politician_trading/scrapers_california.py +412 -0
- mcli/workflow/politician_trading/scrapers_eu.py +377 -0
- mcli/workflow/politician_trading/scrapers_uk.py +350 -0
- mcli/workflow/politician_trading/scrapers_us_states.py +438 -0
- mcli/workflow/politician_trading/supabase_functions.py +354 -0
- mcli/workflow/politician_trading/workflow.py +852 -0
- mcli/workflow/registry/registry.py +180 -0
- mcli/workflow/repo/repo.py +223 -0
- mcli/workflow/scheduler/commands.py +493 -0
- mcli/workflow/scheduler/cron_parser.py +238 -0
- mcli/workflow/scheduler/job.py +182 -0
- mcli/workflow/scheduler/monitor.py +139 -0
- mcli/workflow/scheduler/persistence.py +324 -0
- mcli/workflow/scheduler/scheduler.py +679 -0
- mcli/workflow/sync/sync_cmd.py +437 -0
- mcli/workflow/sync/test_cmd.py +314 -0
- mcli/workflow/videos/videos.py +242 -0
- mcli/workflow/wakatime/wakatime.py +11 -0
- mcli/workflow/workflow.py +37 -0
- mcli_framework-7.0.0.dist-info/METADATA +479 -0
- mcli_framework-7.0.0.dist-info/RECORD +186 -0
- mcli_framework-7.0.0.dist-info/WHEEL +5 -0
- mcli_framework-7.0.0.dist-info/entry_points.txt +7 -0
- mcli_framework-7.0.0.dist-info/licenses/LICENSE +21 -0
- mcli_framework-7.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Comprehensive Data Sources Configuration for Politician Trading/Financial Disclosure Data
|
|
3
|
+
|
|
4
|
+
This file contains the definitive mapping of all publicly accessible politician
|
|
5
|
+
trading and financial disclosure sources across US federal, state, EU, and national levels.
|
|
6
|
+
|
|
7
|
+
Based on 2025 research of available public databases and APIs.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass, field
|
|
11
|
+
from typing import Dict, List, Optional, Literal
|
|
12
|
+
from enum import Enum
|
|
13
|
+
|
|
14
|
+
class DisclosureType(Enum):
|
|
15
|
+
"""Types of financial disclosures available"""
|
|
16
|
+
STOCK_TRANSACTIONS = "stock_transactions" # Individual buy/sell transactions
|
|
17
|
+
FINANCIAL_INTERESTS = "financial_interests" # General financial interests/assets
|
|
18
|
+
ASSET_DECLARATIONS = "asset_declarations" # Property, investments, etc.
|
|
19
|
+
INCOME_SOURCES = "income_sources" # Outside income sources
|
|
20
|
+
CONFLICT_INTERESTS = "conflict_interests" # Potential conflicts of interest
|
|
21
|
+
|
|
22
|
+
class AccessMethod(Enum):
|
|
23
|
+
"""How data can be accessed"""
|
|
24
|
+
WEB_SCRAPING = "web_scraping" # HTML scraping required
|
|
25
|
+
API = "api" # JSON/XML API available
|
|
26
|
+
PDF_PARSING = "pdf_parsing" # PDF documents to parse
|
|
27
|
+
MANUAL_DOWNLOAD = "manual_download" # Manual download required
|
|
28
|
+
DATABASE_QUERY = "database_query" # Direct database access
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class DataSource:
|
|
32
|
+
"""Configuration for a single data source"""
|
|
33
|
+
name: str
|
|
34
|
+
jurisdiction: str # e.g., "US-Federal", "US-CA", "EU", "DE"
|
|
35
|
+
institution: str # e.g., "House", "Senate", "Bundestag"
|
|
36
|
+
url: str
|
|
37
|
+
disclosure_types: List[DisclosureType]
|
|
38
|
+
access_method: AccessMethod
|
|
39
|
+
update_frequency: str # e.g., "daily", "weekly", "monthly"
|
|
40
|
+
threshold_amount: Optional[int] = None # Minimum disclosure amount in USD
|
|
41
|
+
data_format: str = "html" # html, json, xml, pdf
|
|
42
|
+
api_key_required: bool = False
|
|
43
|
+
rate_limits: Optional[str] = None
|
|
44
|
+
historical_data_available: bool = True
|
|
45
|
+
notes: Optional[str] = None
|
|
46
|
+
status: Literal["active", "inactive", "testing", "planned"] = "active"
|
|
47
|
+
|
|
48
|
+
# =============================================================================
|
|
49
|
+
# US FEDERAL SOURCES
|
|
50
|
+
# =============================================================================
|
|
51
|
+
|
|
52
|
+
US_FEDERAL_SOURCES = [
|
|
53
|
+
DataSource(
|
|
54
|
+
name="US House Financial Disclosures",
|
|
55
|
+
jurisdiction="US-Federal",
|
|
56
|
+
institution="House of Representatives",
|
|
57
|
+
url="https://disclosures-clerk.house.gov/FinancialDisclosure",
|
|
58
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS, DisclosureType.ASSET_DECLARATIONS],
|
|
59
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
60
|
+
update_frequency="Real-time (within 30 days of filing)",
|
|
61
|
+
threshold_amount=1000, # $1,000+ transactions must be reported
|
|
62
|
+
data_format="html",
|
|
63
|
+
historical_data_available=True,
|
|
64
|
+
notes="STOCK Act requires prompt disclosure of transactions >$1,000. 8-year archive available.",
|
|
65
|
+
status="active"
|
|
66
|
+
),
|
|
67
|
+
|
|
68
|
+
DataSource(
|
|
69
|
+
name="US Senate Financial Disclosures",
|
|
70
|
+
jurisdiction="US-Federal",
|
|
71
|
+
institution="Senate",
|
|
72
|
+
url="https://efd.senate.gov",
|
|
73
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS, DisclosureType.ASSET_DECLARATIONS],
|
|
74
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
75
|
+
update_frequency="Real-time (within 30 days of filing)",
|
|
76
|
+
threshold_amount=1000, # $1,000+ transactions must be reported
|
|
77
|
+
data_format="html",
|
|
78
|
+
historical_data_available=True,
|
|
79
|
+
notes="Filing threshold $150,160 for 2025. 6-year retention after leaving office.",
|
|
80
|
+
status="active"
|
|
81
|
+
),
|
|
82
|
+
|
|
83
|
+
DataSource(
|
|
84
|
+
name="Office of Government Ethics",
|
|
85
|
+
jurisdiction="US-Federal",
|
|
86
|
+
institution="Executive Branch",
|
|
87
|
+
url="https://www.oge.gov/web/OGE.nsf/Officials Individual Disclosures Search Collection",
|
|
88
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
89
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
90
|
+
update_frequency="Annually",
|
|
91
|
+
data_format="pdf",
|
|
92
|
+
historical_data_available=True,
|
|
93
|
+
notes="Executive branch officials, judges, and senior staff disclosures",
|
|
94
|
+
status="active"
|
|
95
|
+
)
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
# =============================================================================
|
|
99
|
+
# US STATE SOURCES (Selected Major States)
|
|
100
|
+
# =============================================================================
|
|
101
|
+
|
|
102
|
+
US_STATE_SOURCES = [
|
|
103
|
+
# California
|
|
104
|
+
DataSource(
|
|
105
|
+
name="California FPPC Form 700",
|
|
106
|
+
jurisdiction="US-CA",
|
|
107
|
+
institution="State Legislature",
|
|
108
|
+
url="https://netfile.com/Connect2/api/public/list/ANC",
|
|
109
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.INCOME_SOURCES],
|
|
110
|
+
access_method=AccessMethod.API,
|
|
111
|
+
update_frequency="Annually (April deadline)",
|
|
112
|
+
threshold_amount=2000,
|
|
113
|
+
data_format="json",
|
|
114
|
+
api_key_required=False,
|
|
115
|
+
notes="Fair Political Practices Commission Form 700. NetFile API available.",
|
|
116
|
+
status="active"
|
|
117
|
+
),
|
|
118
|
+
|
|
119
|
+
# New York
|
|
120
|
+
DataSource(
|
|
121
|
+
name="New York State Financial Disclosure",
|
|
122
|
+
jurisdiction="US-NY",
|
|
123
|
+
institution="State Legislature",
|
|
124
|
+
url="https://ethics.ny.gov/financial-disclosure-statements-elected-officials",
|
|
125
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.INCOME_SOURCES],
|
|
126
|
+
access_method=AccessMethod.PDF_PARSING,
|
|
127
|
+
update_frequency="Annually (May 15 deadline)",
|
|
128
|
+
data_format="pdf",
|
|
129
|
+
notes="Commission on Ethics and Lobbying in Government",
|
|
130
|
+
status="active"
|
|
131
|
+
),
|
|
132
|
+
|
|
133
|
+
# Florida
|
|
134
|
+
DataSource(
|
|
135
|
+
name="Florida Financial Disclosure",
|
|
136
|
+
jurisdiction="US-FL",
|
|
137
|
+
institution="State Legislature",
|
|
138
|
+
url="https://ethics.state.fl.us/FinancialDisclosure/",
|
|
139
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
140
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
141
|
+
update_frequency="Annually (July 1 deadline, grace period until Sept 1)",
|
|
142
|
+
data_format="html",
|
|
143
|
+
notes="All elected state and local public officers required to file",
|
|
144
|
+
status="active"
|
|
145
|
+
),
|
|
146
|
+
|
|
147
|
+
# Texas
|
|
148
|
+
DataSource(
|
|
149
|
+
name="Texas Ethics Commission",
|
|
150
|
+
jurisdiction="US-TX",
|
|
151
|
+
institution="State Legislature",
|
|
152
|
+
url="https://www.ethics.state.tx.us/search/cf/",
|
|
153
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS],
|
|
154
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
155
|
+
update_frequency="Annually",
|
|
156
|
+
data_format="html",
|
|
157
|
+
status="active"
|
|
158
|
+
),
|
|
159
|
+
|
|
160
|
+
# Michigan
|
|
161
|
+
DataSource(
|
|
162
|
+
name="Michigan Personal Financial Disclosure",
|
|
163
|
+
jurisdiction="US-MI",
|
|
164
|
+
institution="State Legislature",
|
|
165
|
+
url="https://www.michigan.gov/sos/elections/disclosure/personal-financial-disclosure",
|
|
166
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS],
|
|
167
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
168
|
+
update_frequency="Annually",
|
|
169
|
+
data_format="html",
|
|
170
|
+
notes="Candidates for Governor, Lt. Gov, SoS, AG, and Legislature required",
|
|
171
|
+
status="active"
|
|
172
|
+
)
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
# =============================================================================
|
|
176
|
+
# EU PARLIAMENT SOURCES
|
|
177
|
+
# =============================================================================
|
|
178
|
+
|
|
179
|
+
EU_PARLIAMENT_SOURCES = [
|
|
180
|
+
DataSource(
|
|
181
|
+
name="MEP Financial Interest Declarations",
|
|
182
|
+
jurisdiction="EU",
|
|
183
|
+
institution="European Parliament",
|
|
184
|
+
url="https://www.europarl.europa.eu/meps/en/home",
|
|
185
|
+
disclosure_types=[DisclosureType.INCOME_SOURCES, DisclosureType.CONFLICT_INTERESTS],
|
|
186
|
+
access_method=AccessMethod.PDF_PARSING,
|
|
187
|
+
update_frequency="Per legislative term (5 years)",
|
|
188
|
+
threshold_amount=5000, # €5,000+ outside income must be declared
|
|
189
|
+
data_format="pdf",
|
|
190
|
+
notes="Individual MEP pages have declarations. Third-party aggregation by EU Integrity Watch.",
|
|
191
|
+
status="active"
|
|
192
|
+
),
|
|
193
|
+
|
|
194
|
+
DataSource(
|
|
195
|
+
name="EU Integrity Watch",
|
|
196
|
+
jurisdiction="EU",
|
|
197
|
+
institution="Third-party aggregator",
|
|
198
|
+
url="https://www.integritywatch.eu/mepincomes",
|
|
199
|
+
disclosure_types=[DisclosureType.INCOME_SOURCES, DisclosureType.CONFLICT_INTERESTS],
|
|
200
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
201
|
+
update_frequency="Updated after MEP declarations",
|
|
202
|
+
data_format="html",
|
|
203
|
+
notes="Automated extraction from Parliament PDFs. Interactive database available.",
|
|
204
|
+
status="active"
|
|
205
|
+
)
|
|
206
|
+
]
|
|
207
|
+
|
|
208
|
+
# =============================================================================
|
|
209
|
+
# EUROPEAN NATIONAL SOURCES
|
|
210
|
+
# =============================================================================
|
|
211
|
+
|
|
212
|
+
EU_NATIONAL_SOURCES = [
|
|
213
|
+
# Germany
|
|
214
|
+
DataSource(
|
|
215
|
+
name="German Bundestag Member Interests",
|
|
216
|
+
jurisdiction="DE",
|
|
217
|
+
institution="Bundestag",
|
|
218
|
+
url="https://www.bundestag.de/abgeordnete",
|
|
219
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.INCOME_SOURCES],
|
|
220
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
221
|
+
update_frequency="Updated as required",
|
|
222
|
+
threshold_amount=None, # 5% company ownership threshold (down from 25% in 2021)
|
|
223
|
+
data_format="html",
|
|
224
|
+
notes="Transparency Act 2021. Company ownership >5%, tougher bribery laws (1-10 years prison).",
|
|
225
|
+
status="active"
|
|
226
|
+
),
|
|
227
|
+
|
|
228
|
+
# France
|
|
229
|
+
DataSource(
|
|
230
|
+
name="French Parliament Financial Declarations",
|
|
231
|
+
jurisdiction="FR",
|
|
232
|
+
institution="National Assembly & Senate",
|
|
233
|
+
url="https://www.hatvp.fr/", # High Authority for Transparency in Public Life
|
|
234
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
235
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
236
|
+
update_frequency="Annually",
|
|
237
|
+
data_format="html",
|
|
238
|
+
notes="HATVP publishes declarations. Asset declarations for MEPs since 2019. Penalties: 3 years prison + €45,000 fine.",
|
|
239
|
+
status="active"
|
|
240
|
+
),
|
|
241
|
+
|
|
242
|
+
# United Kingdom
|
|
243
|
+
DataSource(
|
|
244
|
+
name="UK Parliament Register of Members' Financial Interests",
|
|
245
|
+
jurisdiction="UK",
|
|
246
|
+
institution="House of Commons",
|
|
247
|
+
url="https://www.parliament.uk/mps-lords-and-offices/standards-and-financial-interests/parliamentary-commissioner-for-standards/registers-of-interests/register-of-members-financial-interests/",
|
|
248
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.INCOME_SOURCES],
|
|
249
|
+
access_method=AccessMethod.API,
|
|
250
|
+
update_frequency="Updated every 2 weeks during sitting periods",
|
|
251
|
+
threshold_amount=70000, # £70,000+ shareholdings (or >15% company ownership)
|
|
252
|
+
data_format="json",
|
|
253
|
+
api_key_required=False,
|
|
254
|
+
notes="Open Parliament Licence API available. Register updated bi-weekly.",
|
|
255
|
+
status="active"
|
|
256
|
+
),
|
|
257
|
+
|
|
258
|
+
DataSource(
|
|
259
|
+
name="UK House of Lords Register of Interests",
|
|
260
|
+
jurisdiction="UK",
|
|
261
|
+
institution="House of Lords",
|
|
262
|
+
url="https://members.parliament.uk/members/lords/interests/register-of-lords-interests",
|
|
263
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.INCOME_SOURCES],
|
|
264
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
265
|
+
update_frequency="Updated regularly",
|
|
266
|
+
data_format="html",
|
|
267
|
+
notes="More detailed shareholding disclosure than Commons. Searchable database.",
|
|
268
|
+
status="active"
|
|
269
|
+
),
|
|
270
|
+
|
|
271
|
+
# Spain
|
|
272
|
+
DataSource(
|
|
273
|
+
name="Spanish Parliament Transparency Portal",
|
|
274
|
+
jurisdiction="ES",
|
|
275
|
+
institution="Congress of Deputies & Senate",
|
|
276
|
+
url="https://www.congreso.es/transparencia",
|
|
277
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS],
|
|
278
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
279
|
+
update_frequency="Updated as required",
|
|
280
|
+
data_format="html",
|
|
281
|
+
notes="Deputies and senators publish institutional agendas with interest representatives. No lobbyist register.",
|
|
282
|
+
status="active"
|
|
283
|
+
),
|
|
284
|
+
|
|
285
|
+
# Italy
|
|
286
|
+
DataSource(
|
|
287
|
+
name="Italian Parliament Financial Declarations",
|
|
288
|
+
jurisdiction="IT",
|
|
289
|
+
institution="Camera dei Deputati & Senato",
|
|
290
|
+
url="https://www.camera.it/leg19/1",
|
|
291
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS],
|
|
292
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
293
|
+
update_frequency="Per legislative term",
|
|
294
|
+
data_format="html",
|
|
295
|
+
notes="Individual member pages contain declarations. Limited standardization.",
|
|
296
|
+
status="testing"
|
|
297
|
+
)
|
|
298
|
+
]
|
|
299
|
+
|
|
300
|
+
# =============================================================================
|
|
301
|
+
# THIRD-PARTY AGGREGATORS AND APIS
|
|
302
|
+
# =============================================================================
|
|
303
|
+
|
|
304
|
+
THIRD_PARTY_SOURCES = [
|
|
305
|
+
DataSource(
|
|
306
|
+
name="OpenSecrets Personal Finances",
|
|
307
|
+
jurisdiction="US-Federal",
|
|
308
|
+
institution="Third-party aggregator",
|
|
309
|
+
url="https://www.opensecrets.org/personal-finances",
|
|
310
|
+
disclosure_types=[DisclosureType.ASSET_DECLARATIONS, DisclosureType.STOCK_TRANSACTIONS],
|
|
311
|
+
access_method=AccessMethod.API,
|
|
312
|
+
update_frequency="Updated from federal filings",
|
|
313
|
+
data_format="json",
|
|
314
|
+
api_key_required=True,
|
|
315
|
+
rate_limits="1000 requests/day",
|
|
316
|
+
notes="Center for Responsive Politics aggregation of federal disclosures.",
|
|
317
|
+
status="active"
|
|
318
|
+
),
|
|
319
|
+
|
|
320
|
+
DataSource(
|
|
321
|
+
name="LegiStorm Financial Disclosures",
|
|
322
|
+
jurisdiction="US-Federal",
|
|
323
|
+
institution="Third-party aggregator",
|
|
324
|
+
url="https://www.legistorm.com/financial_disclosure.html",
|
|
325
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.STOCK_TRANSACTIONS],
|
|
326
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
327
|
+
update_frequency="Real-time from government sources",
|
|
328
|
+
data_format="html",
|
|
329
|
+
notes="Subscription service with enhanced search and analysis tools.",
|
|
330
|
+
status="active"
|
|
331
|
+
),
|
|
332
|
+
|
|
333
|
+
DataSource(
|
|
334
|
+
name="QuiverQuant Congressional Trading",
|
|
335
|
+
jurisdiction="US-Federal",
|
|
336
|
+
institution="Third-party aggregator",
|
|
337
|
+
url="https://api.quiverquant.com/beta/live/congresstrading",
|
|
338
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
339
|
+
access_method=AccessMethod.API,
|
|
340
|
+
update_frequency="Real-time",
|
|
341
|
+
data_format="json",
|
|
342
|
+
api_key_required=True,
|
|
343
|
+
rate_limits="Varies by subscription",
|
|
344
|
+
notes="Financial data company focusing on congressional stock trades.",
|
|
345
|
+
status="active"
|
|
346
|
+
)
|
|
347
|
+
]
|
|
348
|
+
|
|
349
|
+
# =============================================================================
|
|
350
|
+
# CONSOLIDATED SOURCE MAPPING
|
|
351
|
+
# =============================================================================
|
|
352
|
+
|
|
353
|
+
ALL_DATA_SOURCES = {
|
|
354
|
+
"us_federal": US_FEDERAL_SOURCES,
|
|
355
|
+
"us_states": US_STATE_SOURCES,
|
|
356
|
+
"eu_parliament": EU_PARLIAMENT_SOURCES,
|
|
357
|
+
"eu_national": EU_NATIONAL_SOURCES,
|
|
358
|
+
"third_party": THIRD_PARTY_SOURCES
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
# Summary statistics
|
|
362
|
+
TOTAL_SOURCES = sum(len(sources) for sources in ALL_DATA_SOURCES.values())
|
|
363
|
+
ACTIVE_SOURCES = sum(
|
|
364
|
+
len([s for s in sources if s.status == "active"])
|
|
365
|
+
for sources in ALL_DATA_SOURCES.values()
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
def get_sources_by_jurisdiction(jurisdiction: str) -> List[DataSource]:
|
|
369
|
+
"""Get all sources for a specific jurisdiction (e.g., 'US-CA', 'DE', 'EU')"""
|
|
370
|
+
all_sources = []
|
|
371
|
+
for source_group in ALL_DATA_SOURCES.values():
|
|
372
|
+
all_sources.extend([s for s in source_group if s.jurisdiction == jurisdiction])
|
|
373
|
+
return all_sources
|
|
374
|
+
|
|
375
|
+
def get_sources_by_type(disclosure_type: DisclosureType) -> List[DataSource]:
|
|
376
|
+
"""Get all sources that provide a specific type of disclosure"""
|
|
377
|
+
all_sources = []
|
|
378
|
+
for source_group in ALL_DATA_SOURCES.values():
|
|
379
|
+
all_sources.extend([s for s in source_group if disclosure_type in s.disclosure_types])
|
|
380
|
+
return all_sources
|
|
381
|
+
|
|
382
|
+
def get_api_sources() -> List[DataSource]:
|
|
383
|
+
"""Get all sources that provide API access"""
|
|
384
|
+
all_sources = []
|
|
385
|
+
for source_group in ALL_DATA_SOURCES.values():
|
|
386
|
+
all_sources.extend([s for s in source_group if s.access_method == AccessMethod.API])
|
|
387
|
+
return all_sources
|
|
388
|
+
|
|
389
|
+
# Export for use in workflow configuration
|
|
390
|
+
__all__ = [
|
|
391
|
+
'DataSource', 'DisclosureType', 'AccessMethod',
|
|
392
|
+
'ALL_DATA_SOURCES', 'get_sources_by_jurisdiction',
|
|
393
|
+
'get_sources_by_type', 'get_api_sources',
|
|
394
|
+
'TOTAL_SOURCES', 'ACTIVE_SOURCES'
|
|
395
|
+
]
|