mcli-framework 7.1.3__py3-none-any.whl → 7.2.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/main.py +10 -0
- mcli/lib/custom_commands.py +424 -0
- mcli/lib/paths.py +12 -0
- mcli/ml/dashboard/app.py +13 -13
- mcli/ml/dashboard/app_integrated.py +1292 -148
- mcli/ml/dashboard/app_supabase.py +46 -21
- mcli/ml/dashboard/app_training.py +14 -14
- mcli/ml/dashboard/components/charts.py +258 -0
- mcli/ml/dashboard/components/metrics.py +125 -0
- mcli/ml/dashboard/components/tables.py +228 -0
- mcli/ml/dashboard/pages/cicd.py +382 -0
- mcli/ml/dashboard/pages/predictions_enhanced.py +820 -0
- mcli/ml/dashboard/pages/scrapers_and_logs.py +1060 -0
- mcli/ml/dashboard/pages/workflows.py +533 -0
- mcli/ml/training/train_model.py +569 -0
- mcli/self/self_cmd.py +322 -94
- mcli/workflow/politician_trading/data_sources.py +259 -1
- mcli/workflow/politician_trading/models.py +159 -1
- mcli/workflow/politician_trading/scrapers_corporate_registry.py +846 -0
- mcli/workflow/politician_trading/scrapers_free_sources.py +516 -0
- mcli/workflow/politician_trading/scrapers_third_party.py +391 -0
- mcli/workflow/politician_trading/seed_database.py +539 -0
- mcli/workflow/workflow.py +8 -27
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.2.0.dist-info}/METADATA +1 -1
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.2.0.dist-info}/RECORD +29 -25
- mcli/workflow/daemon/api_daemon.py +0 -800
- mcli/workflow/daemon/commands.py +0 -1196
- mcli/workflow/dashboard/dashboard_cmd.py +0 -120
- mcli/workflow/file/file.py +0 -100
- mcli/workflow/git_commit/commands.py +0 -430
- mcli/workflow/politician_trading/commands.py +0 -1939
- mcli/workflow/scheduler/commands.py +0 -493
- mcli/workflow/sync/sync_cmd.py +0 -437
- mcli/workflow/videos/videos.py +0 -242
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.2.0.dist-info}/WHEEL +0 -0
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.2.0.dist-info}/entry_points.txt +0 -0
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.2.0.dist-info}/licenses/LICENSE +0 -0
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.2.0.dist-info}/top_level.txt +0 -0
|
@@ -297,6 +297,20 @@ EU_NATIONAL_SOURCES = [
|
|
|
297
297
|
# =============================================================================
|
|
298
298
|
|
|
299
299
|
THIRD_PARTY_SOURCES = [
|
|
300
|
+
DataSource(
|
|
301
|
+
name="Senate Stock Watcher (GitHub)",
|
|
302
|
+
jurisdiction="US-Federal",
|
|
303
|
+
institution="Third-party aggregator",
|
|
304
|
+
url="https://github.com/timothycarambat/senate-stock-watcher-data",
|
|
305
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
306
|
+
access_method=AccessMethod.API,
|
|
307
|
+
update_frequency="Continuously updated from Senate filings",
|
|
308
|
+
data_format="json",
|
|
309
|
+
api_key_required=False,
|
|
310
|
+
rate_limits="GitHub rate limits",
|
|
311
|
+
notes="FREE! Automated aggregation of Senate PTR filings. JSON dataset updated continuously. All historical data available in all_transactions.json. No API key required!",
|
|
312
|
+
status="active",
|
|
313
|
+
),
|
|
300
314
|
DataSource(
|
|
301
315
|
name="OpenSecrets Personal Finances",
|
|
302
316
|
jurisdiction="US-Federal",
|
|
@@ -327,6 +341,20 @@ THIRD_PARTY_SOURCES = [
|
|
|
327
341
|
name="QuiverQuant Congressional Trading",
|
|
328
342
|
jurisdiction="US-Federal",
|
|
329
343
|
institution="Third-party aggregator",
|
|
344
|
+
url="https://www.quiverquant.com/congresstrading/",
|
|
345
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
346
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
347
|
+
update_frequency="Real-time",
|
|
348
|
+
data_format="html",
|
|
349
|
+
api_key_required=False,
|
|
350
|
+
rate_limits="Web scraping rate limits apply",
|
|
351
|
+
notes="Financial data company focusing on congressional stock trades. Web interface with trade details, filing dates, and performance metrics. Premium API available.",
|
|
352
|
+
status="active",
|
|
353
|
+
),
|
|
354
|
+
DataSource(
|
|
355
|
+
name="QuiverQuant API",
|
|
356
|
+
jurisdiction="US-Federal",
|
|
357
|
+
institution="Third-party aggregator",
|
|
330
358
|
url="https://api.quiverquant.com/beta/live/congresstrading",
|
|
331
359
|
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
332
360
|
access_method=AccessMethod.API,
|
|
@@ -334,7 +362,236 @@ THIRD_PARTY_SOURCES = [
|
|
|
334
362
|
data_format="json",
|
|
335
363
|
api_key_required=True,
|
|
336
364
|
rate_limits="Varies by subscription",
|
|
337
|
-
notes="
|
|
365
|
+
notes="Premium API for QuiverQuant congressional trading data. Requires subscription.",
|
|
366
|
+
status="active",
|
|
367
|
+
),
|
|
368
|
+
DataSource(
|
|
369
|
+
name="StockNear Politicians",
|
|
370
|
+
jurisdiction="US-Federal",
|
|
371
|
+
institution="Third-party aggregator",
|
|
372
|
+
url="https://stocknear.com/politicians",
|
|
373
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
374
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
375
|
+
update_frequency="Real-time",
|
|
376
|
+
data_format="html",
|
|
377
|
+
api_key_required=False,
|
|
378
|
+
notes="Tracks 299 politicians with trade counts, districts, last trade dates, and party affiliation. Pro subscription for unlimited access.",
|
|
379
|
+
status="active",
|
|
380
|
+
),
|
|
381
|
+
DataSource(
|
|
382
|
+
name="Barchart Politician Insider Trading",
|
|
383
|
+
jurisdiction="US-Federal",
|
|
384
|
+
institution="Third-party aggregator",
|
|
385
|
+
url="https://www.barchart.com/investing-ideas/politician-insider-trading",
|
|
386
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
387
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
388
|
+
update_frequency="Updated within 45 days of transaction",
|
|
389
|
+
data_format="html",
|
|
390
|
+
threshold_amount=None,
|
|
391
|
+
notes="Tracks House and Senate trades from last 60 days. Includes buy/sell counts and transaction totals. CSV export available.",
|
|
392
|
+
status="active",
|
|
393
|
+
),
|
|
394
|
+
DataSource(
|
|
395
|
+
name="ProPublica Congress API",
|
|
396
|
+
jurisdiction="US-Federal",
|
|
397
|
+
institution="Third-party aggregator",
|
|
398
|
+
url="https://api.propublica.org/congress/v1",
|
|
399
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS, DisclosureType.FINANCIAL_INTERESTS],
|
|
400
|
+
access_method=AccessMethod.API,
|
|
401
|
+
update_frequency="Daily",
|
|
402
|
+
data_format="json",
|
|
403
|
+
api_key_required=True,
|
|
404
|
+
rate_limits="5000 requests/day (free tier)",
|
|
405
|
+
notes="DEPRECATED: ProPublica Congress API is no longer available as of 2025. Use Senate Stock Watcher or Finnhub instead.",
|
|
406
|
+
status="inactive",
|
|
407
|
+
),
|
|
408
|
+
DataSource(
|
|
409
|
+
name="Finnhub Congressional Trading",
|
|
410
|
+
jurisdiction="US-Federal",
|
|
411
|
+
institution="Third-party aggregator",
|
|
412
|
+
url="https://finnhub.io/docs/api/congressional-trading",
|
|
413
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
414
|
+
access_method=AccessMethod.API,
|
|
415
|
+
update_frequency="Real-time",
|
|
416
|
+
data_format="json",
|
|
417
|
+
api_key_required=True,
|
|
418
|
+
rate_limits="30 requests/second (free tier)",
|
|
419
|
+
notes="FREE API key available at finnhub.io. Provides congressional trading data by stock symbol. Response includes representative name, transaction date/type, and amount ranges.",
|
|
420
|
+
status="active",
|
|
421
|
+
),
|
|
422
|
+
DataSource(
|
|
423
|
+
name="SEC Edgar Insider Trading",
|
|
424
|
+
jurisdiction="US-Federal",
|
|
425
|
+
institution="Official government source",
|
|
426
|
+
url="https://data.sec.gov",
|
|
427
|
+
disclosure_types=[DisclosureType.STOCK_TRANSACTIONS],
|
|
428
|
+
access_method=AccessMethod.API,
|
|
429
|
+
update_frequency="Real-time",
|
|
430
|
+
data_format="json",
|
|
431
|
+
api_key_required=False,
|
|
432
|
+
rate_limits="10 requests/second",
|
|
433
|
+
notes="FREE! Official SEC data. Access company submissions and Form 4 insider trading filings via data.sec.gov/submissions/CIK##########.json. Requires User-Agent header.",
|
|
434
|
+
status="active",
|
|
435
|
+
),
|
|
436
|
+
]
|
|
437
|
+
|
|
438
|
+
# =============================================================================
|
|
439
|
+
# CORPORATE REGISTRY & FINANCIAL DISCLOSURE SOURCES
|
|
440
|
+
# =============================================================================
|
|
441
|
+
|
|
442
|
+
CORPORATE_REGISTRY_SOURCES = [
|
|
443
|
+
DataSource(
|
|
444
|
+
name="UK Companies House REST API",
|
|
445
|
+
jurisdiction="UK",
|
|
446
|
+
institution="Companies House (UK company registry)",
|
|
447
|
+
url="https://api.companieshouse.gov.uk/",
|
|
448
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
449
|
+
access_method=AccessMethod.API,
|
|
450
|
+
update_frequency="Real-time",
|
|
451
|
+
data_format="json",
|
|
452
|
+
api_key_required=True,
|
|
453
|
+
rate_limits="600 requests per 5 minutes per key",
|
|
454
|
+
notes="HTTP Basic Auth using API key as username. Endpoints: /company/{company_number}, /company/{company_number}/filing-history, /officers, /persons-with-significant-control, /search/companies. Some filings/accounts documents are metadata only, not full financial statement parsing. Docs: https://developer.company-information.service.gov.uk/",
|
|
455
|
+
status="active",
|
|
456
|
+
),
|
|
457
|
+
DataSource(
|
|
458
|
+
name="UK Companies House Streaming API",
|
|
459
|
+
jurisdiction="UK",
|
|
460
|
+
institution="Companies House (UK company registry)",
|
|
461
|
+
url="https://stream.companieshouse.gov.uk/",
|
|
462
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
463
|
+
access_method=AccessMethod.API,
|
|
464
|
+
update_frequency="Real-time (streaming)",
|
|
465
|
+
data_format="json",
|
|
466
|
+
api_key_required=True,
|
|
467
|
+
rate_limits="Streaming connection",
|
|
468
|
+
notes="Streaming API for real-time company changes. Requires stream key obtained via registration. Streams: company information, filing history, insolvency, charges. Delivers JSON events as changes occur. Useful for real-time updates vs polling REST API. Docs: https://www.api.gov.uk/ch/companies-house-streaming/",
|
|
469
|
+
status="active",
|
|
470
|
+
),
|
|
471
|
+
DataSource(
|
|
472
|
+
name="GetEDGE API (ASIC Australia)",
|
|
473
|
+
jurisdiction="Australia",
|
|
474
|
+
institution="ASIC (Australian Securities and Investments Commission)",
|
|
475
|
+
url="https://getedge.com.au/docs/api",
|
|
476
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
477
|
+
access_method=AccessMethod.API,
|
|
478
|
+
update_frequency="Real-time",
|
|
479
|
+
data_format="json",
|
|
480
|
+
api_key_required=True,
|
|
481
|
+
rate_limits="Varies by subscription",
|
|
482
|
+
notes="Token (API key) authentication. 60-character API key via account portal. Endpoints: Company Registration, Name Change, Business Name Registration, Registry Agent Services, Document production. Oriented to registry/incorporation/document services rather than full financial disclosure data. Requires 'software provider' / digital agent status for some endpoints. Docs: https://getedge.com.au/docs/api",
|
|
483
|
+
status="active",
|
|
484
|
+
),
|
|
485
|
+
DataSource(
|
|
486
|
+
name="Info-Financière API (France)",
|
|
487
|
+
jurisdiction="France",
|
|
488
|
+
institution="AMF (Autorité des marchés financiers)",
|
|
489
|
+
url="https://info-financiere.gouv.fr/api/v1/console",
|
|
490
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.STOCK_TRANSACTIONS],
|
|
491
|
+
access_method=AccessMethod.API,
|
|
492
|
+
update_frequency="Real-time",
|
|
493
|
+
data_format="json",
|
|
494
|
+
api_key_required=False,
|
|
495
|
+
rate_limits="10,000 API calls per IP per day",
|
|
496
|
+
notes="FREE! Open access (accès libre) via OpenData service for publicly listed/regulated disclosures. Returns metadata + original documents (PDF, HTML, XML) plus links. Documents are in issuer's original language and format - not always fully parsed. Some regulatory constraints on personal data/redaction may apply. Docs: https://www.data.gouv.fr/dataservices/api-info-financiere/",
|
|
497
|
+
status="active",
|
|
498
|
+
),
|
|
499
|
+
DataSource(
|
|
500
|
+
name="Hong Kong Companies Registry e-Monitor API",
|
|
501
|
+
jurisdiction="Hong Kong",
|
|
502
|
+
institution="Companies Registry (Hong Kong)",
|
|
503
|
+
url="https://www.cr.gov.hk/en/electronic/e-servicesportal/",
|
|
504
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
505
|
+
access_method=AccessMethod.API,
|
|
506
|
+
update_frequency="Real-time (notifications)",
|
|
507
|
+
data_format="json",
|
|
508
|
+
api_key_required=True,
|
|
509
|
+
rate_limits="N/A (notification-based)",
|
|
510
|
+
notes="Notification/subscription API - not full search/document retrieval. Users must register and subscribe to 'Other Companies' service (HK$17/year per company) to receive notifications via API. Notifications are JSON via HTTPS POST to subscriber's endpoint. Payload includes change data and encrypted API key header for verification. API endpoint must support HTTPS and validate certificate. Docs: https://www.cr.gov.hk/en/electronic/e-servicesportal/faq/e-monitor.htm",
|
|
511
|
+
status="active",
|
|
512
|
+
),
|
|
513
|
+
DataSource(
|
|
514
|
+
name="Hong Kong Companies Registry (General)",
|
|
515
|
+
jurisdiction="Hong Kong",
|
|
516
|
+
institution="Companies Registry (Hong Kong)",
|
|
517
|
+
url="https://www.cr.gov.hk/en/electronic/e-servicesportal/",
|
|
518
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
519
|
+
access_method=AccessMethod.WEB_SCRAPING,
|
|
520
|
+
update_frequency="Real-time",
|
|
521
|
+
data_format="html",
|
|
522
|
+
api_key_required=True,
|
|
523
|
+
rate_limits="Portal-based",
|
|
524
|
+
notes="Requires login/account. Public search services via portal. Not a fully open API. Outputs may be HTML, images, document scans; limited structured data. Corporate registry made more restrictive: directors' residential address/identity data partly redacted; only limited shareholder details publicly accessible. No full open API - requires portal access or purchase.",
|
|
525
|
+
status="planned",
|
|
526
|
+
),
|
|
527
|
+
DataSource(
|
|
528
|
+
name="OpenCorporates API",
|
|
529
|
+
jurisdiction="Global",
|
|
530
|
+
institution="Third-party aggregator (multi-jurisdiction)",
|
|
531
|
+
url="https://api.opencorporates.com/v0.4/",
|
|
532
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
533
|
+
access_method=AccessMethod.API,
|
|
534
|
+
update_frequency="Daily",
|
|
535
|
+
data_format="json",
|
|
536
|
+
api_key_required=True,
|
|
537
|
+
rate_limits="Varies by tier (free + paid)",
|
|
538
|
+
notes="Global multi-jurisdiction aggregator. Endpoints: /companies/{jurisdiction}/{company_id}, /companies/search, /officers, /filings, /events. Supports pagination. Query parameters: q, jurisdiction_code, company_number, per_page, page, order. Depth of filings/events data depends on jurisdiction and data source - many 'filings' may just be metadata or pointers to documents rather than full statements. Rate limits apply per key. Docs: https://api.opencorporates.com/documentation/API-Reference",
|
|
539
|
+
status="active",
|
|
540
|
+
),
|
|
541
|
+
DataSource(
|
|
542
|
+
name="Transparent Data - Company Registers API",
|
|
543
|
+
jurisdiction="EU/Europe",
|
|
544
|
+
institution="Third-party aggregator (EU registry metadata)",
|
|
545
|
+
url="https://apidoc.transparentdata.pl/company_registers_api.html",
|
|
546
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
547
|
+
access_method=AccessMethod.API,
|
|
548
|
+
update_frequency="Daily",
|
|
549
|
+
data_format="json",
|
|
550
|
+
api_key_required=True,
|
|
551
|
+
rate_limits="Varies by subscription",
|
|
552
|
+
notes="EU/Europe registry aggregator. Covers registry/legal metadata rather than full financial statements or regulatory filings. Likely JSON REST style with parameters for jurisdiction, company registration number, etc. Docs: https://apidoc.transparentdata.pl/company_registers_api.html",
|
|
553
|
+
status="active",
|
|
554
|
+
),
|
|
555
|
+
DataSource(
|
|
556
|
+
name="XBRL/ESEF/UKSEF via filings.xbrl.org",
|
|
557
|
+
jurisdiction="EU/UK/Ukraine",
|
|
558
|
+
institution="XBRL International (standardized financial reporting)",
|
|
559
|
+
url="https://filings.xbrl.org/",
|
|
560
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.ASSET_DECLARATIONS],
|
|
561
|
+
access_method=AccessMethod.API,
|
|
562
|
+
update_frequency="Daily",
|
|
563
|
+
data_format="json",
|
|
564
|
+
api_key_required=False,
|
|
565
|
+
rate_limits="None specified",
|
|
566
|
+
notes="FREE! JSON:API compliant responses. Filtering via query parameters (filter[...]), pagination, sorting. Covers EU/UK/Ukraine filings. Some jurisdictions' filings missing (e.g., Germany, Ireland) as of current state. Endpoints: /filings, /entities, /validation_messages. Docs: https://filings.xbrl.org/docs/api",
|
|
567
|
+
status="active",
|
|
568
|
+
),
|
|
569
|
+
DataSource(
|
|
570
|
+
name="XBRL US API",
|
|
571
|
+
jurisdiction="USA",
|
|
572
|
+
institution="XBRL US (financial data standardization)",
|
|
573
|
+
url="https://github.com/xbrlus/xbrl-api",
|
|
574
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.STOCK_TRANSACTIONS],
|
|
575
|
+
access_method=AccessMethod.API,
|
|
576
|
+
update_frequency="Real-time (~15 min latency from SEC)",
|
|
577
|
+
data_format="json",
|
|
578
|
+
api_key_required=True,
|
|
579
|
+
rate_limits="Varies by tier",
|
|
580
|
+
notes="FREE API key available. JSON/REST endpoints for company, filing, facts. Fact-level retrieval mapping XBRL tags to numeric values. Latency ~15 minutes behind SEC updates. Best for programmatic fact extraction from SEC filings. Docs: https://github.com/xbrlus/xbrl-api",
|
|
581
|
+
status="active",
|
|
582
|
+
),
|
|
583
|
+
DataSource(
|
|
584
|
+
name="XBRLAnalyst API",
|
|
585
|
+
jurisdiction="USA",
|
|
586
|
+
institution="Third-party aggregator (SEC filings)",
|
|
587
|
+
url="https://www.finddynamics.com/",
|
|
588
|
+
disclosure_types=[DisclosureType.FINANCIAL_INTERESTS, DisclosureType.STOCK_TRANSACTIONS],
|
|
589
|
+
access_method=AccessMethod.API,
|
|
590
|
+
update_frequency="Real-time",
|
|
591
|
+
data_format="json",
|
|
592
|
+
api_key_required=True,
|
|
593
|
+
rate_limits="Varies by subscription",
|
|
594
|
+
notes="Endpoints for firms, filings, statements, metrics. JSON (default) or XML (via format parameter). Free (limited) access for non-registered users for core metrics; full access for subscribers. Focused on US public companies (SEC filings).",
|
|
338
595
|
status="active",
|
|
339
596
|
),
|
|
340
597
|
]
|
|
@@ -349,6 +606,7 @@ ALL_DATA_SOURCES = {
|
|
|
349
606
|
"eu_parliament": EU_PARLIAMENT_SOURCES,
|
|
350
607
|
"eu_national": EU_NATIONAL_SOURCES,
|
|
351
608
|
"third_party": THIRD_PARTY_SOURCES,
|
|
609
|
+
"corporate_registry": CORPORATE_REGISTRY_SOURCES,
|
|
352
610
|
}
|
|
353
611
|
|
|
354
612
|
# Summary statistics
|
|
@@ -64,7 +64,7 @@ class Politician:
|
|
|
64
64
|
first_name: str = ""
|
|
65
65
|
last_name: str = ""
|
|
66
66
|
full_name: str = ""
|
|
67
|
-
role:
|
|
67
|
+
role: str = "House" # Can be string or PoliticianRole enum
|
|
68
68
|
party: str = ""
|
|
69
69
|
state_or_country: str = ""
|
|
70
70
|
district: Optional[str] = None
|
|
@@ -85,6 +85,7 @@ class TradingDisclosure:
|
|
|
85
85
|
|
|
86
86
|
id: Optional[str] = None
|
|
87
87
|
politician_id: str = ""
|
|
88
|
+
politician_bioguide_id: Optional[str] = None # For lookups before politician_id is assigned
|
|
88
89
|
|
|
89
90
|
# Transaction details
|
|
90
91
|
transaction_date: datetime = field(default_factory=datetime.utcnow)
|
|
@@ -163,3 +164,160 @@ class DataSource:
|
|
|
163
164
|
|
|
164
165
|
created_at: datetime = field(default_factory=datetime.utcnow)
|
|
165
166
|
updated_at: datetime = field(default_factory=datetime.utcnow)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# =============================================================================
|
|
170
|
+
# Corporate Registry Models
|
|
171
|
+
# =============================================================================
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@dataclass
|
|
175
|
+
class Company:
|
|
176
|
+
"""Corporate registry company information"""
|
|
177
|
+
|
|
178
|
+
id: Optional[str] = None
|
|
179
|
+
company_number: str = "" # Registration number in jurisdiction
|
|
180
|
+
company_name: str = ""
|
|
181
|
+
jurisdiction: str = "" # Country/region code (e.g., "GB", "US", "FR")
|
|
182
|
+
|
|
183
|
+
# Company details
|
|
184
|
+
company_type: Optional[str] = None
|
|
185
|
+
status: str = "active" # active, dissolved, liquidation, etc.
|
|
186
|
+
incorporation_date: Optional[datetime] = None
|
|
187
|
+
registered_address: Optional[str] = None
|
|
188
|
+
|
|
189
|
+
# Business information
|
|
190
|
+
sic_codes: List[str] = field(default_factory=list) # Standard Industrial Classification
|
|
191
|
+
nature_of_business: Optional[str] = None
|
|
192
|
+
|
|
193
|
+
# Source information
|
|
194
|
+
source: str = "" # "uk_companies_house", "opencorporates", etc.
|
|
195
|
+
source_url: Optional[str] = None
|
|
196
|
+
raw_data: Dict[str, Any] = field(default_factory=dict)
|
|
197
|
+
|
|
198
|
+
created_at: datetime = field(default_factory=datetime.utcnow)
|
|
199
|
+
updated_at: datetime = field(default_factory=datetime.utcnow)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
@dataclass
|
|
203
|
+
class CompanyOfficer:
|
|
204
|
+
"""Company officer/director information"""
|
|
205
|
+
|
|
206
|
+
id: Optional[str] = None
|
|
207
|
+
company_id: str = "" # Foreign key to Company
|
|
208
|
+
|
|
209
|
+
# Officer details
|
|
210
|
+
name: str = ""
|
|
211
|
+
officer_role: str = "" # director, secretary, etc.
|
|
212
|
+
appointed_on: Optional[datetime] = None
|
|
213
|
+
resigned_on: Optional[datetime] = None
|
|
214
|
+
|
|
215
|
+
# Personal details (may be limited by privacy laws)
|
|
216
|
+
nationality: Optional[str] = None
|
|
217
|
+
occupation: Optional[str] = None
|
|
218
|
+
country_of_residence: Optional[str] = None
|
|
219
|
+
date_of_birth: Optional[datetime] = None # Often only month/year available
|
|
220
|
+
|
|
221
|
+
# Address (often redacted for privacy)
|
|
222
|
+
address: Optional[str] = None
|
|
223
|
+
|
|
224
|
+
# Source information
|
|
225
|
+
source: str = ""
|
|
226
|
+
raw_data: Dict[str, Any] = field(default_factory=dict)
|
|
227
|
+
|
|
228
|
+
created_at: datetime = field(default_factory=datetime.utcnow)
|
|
229
|
+
updated_at: datetime = field(default_factory=datetime.utcnow)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
@dataclass
|
|
233
|
+
class PersonWithSignificantControl:
|
|
234
|
+
"""Person with significant control (PSC) - UK Companies House"""
|
|
235
|
+
|
|
236
|
+
id: Optional[str] = None
|
|
237
|
+
company_id: str = "" # Foreign key to Company
|
|
238
|
+
|
|
239
|
+
# PSC details
|
|
240
|
+
name: str = ""
|
|
241
|
+
kind: str = "" # individual-person-with-significant-control, corporate-entity-person-with-significant-control, etc.
|
|
242
|
+
|
|
243
|
+
# Control nature
|
|
244
|
+
natures_of_control: List[str] = field(default_factory=list) # ownership-of-shares-75-to-100-percent, etc.
|
|
245
|
+
notified_on: Optional[datetime] = None
|
|
246
|
+
|
|
247
|
+
# Personal details (may be redacted)
|
|
248
|
+
nationality: Optional[str] = None
|
|
249
|
+
country_of_residence: Optional[str] = None
|
|
250
|
+
date_of_birth: Optional[datetime] = None # Usually only month/year
|
|
251
|
+
|
|
252
|
+
# Address
|
|
253
|
+
address: Optional[str] = None
|
|
254
|
+
|
|
255
|
+
# Source information
|
|
256
|
+
source: str = ""
|
|
257
|
+
raw_data: Dict[str, Any] = field(default_factory=dict)
|
|
258
|
+
|
|
259
|
+
created_at: datetime = field(default_factory=datetime.utcnow)
|
|
260
|
+
updated_at: datetime = field(default_factory=datetime.utcnow)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
@dataclass
|
|
264
|
+
class FinancialPublication:
|
|
265
|
+
"""Financial publication/disclosure (e.g., France Info-Financière)"""
|
|
266
|
+
|
|
267
|
+
id: Optional[str] = None
|
|
268
|
+
publication_id: str = "" # Source publication ID
|
|
269
|
+
|
|
270
|
+
# Publication details
|
|
271
|
+
title: str = ""
|
|
272
|
+
publication_type: str = "" # prospectus, annual-report, regulatory-filing, etc.
|
|
273
|
+
publication_date: datetime = field(default_factory=datetime.utcnow)
|
|
274
|
+
|
|
275
|
+
# Issuer/company
|
|
276
|
+
issuer_name: Optional[str] = None
|
|
277
|
+
issuer_id: Optional[str] = None # LEI, ISIN, or other identifier
|
|
278
|
+
company_id: Optional[str] = None # Foreign key to Company (if linked)
|
|
279
|
+
|
|
280
|
+
# Document information
|
|
281
|
+
document_url: Optional[str] = None
|
|
282
|
+
document_format: Optional[str] = None # pdf, html, xml
|
|
283
|
+
language: Optional[str] = None
|
|
284
|
+
|
|
285
|
+
# Source information
|
|
286
|
+
source: str = "" # "info_financiere", "xbrl_filings", etc.
|
|
287
|
+
jurisdiction: str = ""
|
|
288
|
+
raw_data: Dict[str, Any] = field(default_factory=dict)
|
|
289
|
+
|
|
290
|
+
created_at: datetime = field(default_factory=datetime.utcnow)
|
|
291
|
+
updated_at: datetime = field(default_factory=datetime.utcnow)
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
@dataclass
|
|
295
|
+
class XBRLFiling:
|
|
296
|
+
"""XBRL financial statement filing"""
|
|
297
|
+
|
|
298
|
+
id: Optional[str] = None
|
|
299
|
+
filing_id: str = "" # Source filing ID
|
|
300
|
+
|
|
301
|
+
# Filing details
|
|
302
|
+
entity_name: str = ""
|
|
303
|
+
entity_id: Optional[str] = None # LEI or other identifier
|
|
304
|
+
company_id: Optional[str] = None # Foreign key to Company (if linked)
|
|
305
|
+
|
|
306
|
+
# Filing information
|
|
307
|
+
filing_date: datetime = field(default_factory=datetime.utcnow)
|
|
308
|
+
period_start: Optional[datetime] = None
|
|
309
|
+
period_end: Optional[datetime] = None
|
|
310
|
+
fiscal_year: Optional[int] = None
|
|
311
|
+
fiscal_period: Optional[str] = None # Q1, Q2, FY, etc.
|
|
312
|
+
|
|
313
|
+
# Document
|
|
314
|
+
document_url: Optional[str] = None
|
|
315
|
+
taxonomy: Optional[str] = None # ESEF, UKSEF, US-GAAP, etc.
|
|
316
|
+
|
|
317
|
+
# Source information
|
|
318
|
+
source: str = "" # "xbrl_filings", "xbrl_us", etc.
|
|
319
|
+
jurisdiction: str = ""
|
|
320
|
+
raw_data: Dict[str, Any] = field(default_factory=dict)
|
|
321
|
+
|
|
322
|
+
created_at: datetime = field(default_factory=datetime.utcnow)
|
|
323
|
+
updated_at: datetime = field(default_factory=datetime.utcnow)
|