mirror of
https://github.com/shawnkim1997/All-in-one-Financial-Analysis.git
synced 2026-08-21 14:48:05 +00:00
- Add missing numpy, scipy, dbnomics to requirements.txt (fixes ImportError on fresh install) - Sync claude.md with actual codebase: §3 file structure (37 services, 21 routers), §5 API endpoints (92 routes), §6 frontend pages (12), §13 TODO status - Update README.md with current architecture (92 API routes, 21 routers, 37 services), multi-asset overview, research grid, macro dashboard, screener+backtest, multi-jurisdiction filings, and 2026-03-26 changelog entry - Add new routers: dart, edinet, fmp, macro, research - Add new services: cache, dart_fetcher, dart_filing_service, economic_calendar, ecos_fetcher, edinet_filing_service, fmp_client, global_macro_quadrant, kpi_history_service, macro_cycle, macro_fetcher, oecd_cycle, peer_comparison_service, research_dashboard, smart_money_service, yield_fx_service - Add new frontend: macro page, screener+backtest, research grid components, overview (Equity/ETF/Commodity), filings (SEC/DART/EDINET), error boundaries - Remove 6 unused services: copilot_context, crypto_fetcher, fx_fetcher, gemini_analysis, market_data, technical_analysis - Remove obsolete docs: .agent/, AGENT.md, ATLAS_EVALUATION.md, docs/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
1.3 KiB
Python
51 lines
1.3 KiB
Python
"""DART (Korea disclosure) helpers via dart-fss (requires ``DART_API_KEY``)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
from typing import Any, Dict, List
|
|
|
|
|
|
def dart_is_configured() -> bool:
|
|
return bool((os.getenv("DART_API_KEY") or "").strip())
|
|
|
|
|
|
def search_corporations(query: str, limit: int = 20) -> List[Dict[str, Any]]:
|
|
"""Search listed companies by Korean/English name (best effort)."""
|
|
key = (os.getenv("DART_API_KEY") or "").strip()
|
|
q = (query or "").strip()
|
|
if not key or not q:
|
|
return []
|
|
|
|
try:
|
|
import dart_fss as dart # noqa: WPS433
|
|
except ImportError:
|
|
return []
|
|
|
|
try:
|
|
dart.set_api_key(key)
|
|
corp_list = dart.get_corp_list()
|
|
found = corp_list.find_by_corp_name(q, exactly=False)
|
|
except Exception:
|
|
return []
|
|
|
|
if found is None:
|
|
return []
|
|
|
|
out: List[Dict[str, Any]] = []
|
|
for item in list(found)[:limit]:
|
|
row: Dict[str, Any] = {}
|
|
for attr in (
|
|
"corp_name",
|
|
"corp_eng_name",
|
|
"corp_code",
|
|
"stock_code",
|
|
"modify_date",
|
|
):
|
|
if hasattr(item, attr):
|
|
row[attr] = getattr(item, attr)
|
|
if not row:
|
|
row["repr"] = repr(item)
|
|
out.append(row)
|
|
return out
|