mirror of
https://github.com/shawnkim1997/All-in-one-Financial-Analysis.git
synced 2026-08-20 22:28:05 +00:00
29 lines
1014 B
Python
29 lines
1014 B
Python
"""Korea Investment Securities provider placeholder.
|
|
|
|
KIS should become the first provider for Korean equities once credentials and
|
|
the concrete client are wired. Keeping it as a provider now lets the chain
|
|
ordering and feature-flagged migration land without touching routers.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from server.core.providers.base import BaseProvider, ProviderNotConfigured
|
|
|
|
|
|
class KISProvider(BaseProvider):
|
|
name = "kis"
|
|
|
|
def supports_symbol(self, symbol: str) -> bool:
|
|
normalized = symbol.strip().upper()
|
|
return normalized.endswith(".KS") or normalized.endswith(".KQ") or normalized[:6].isdigit()
|
|
|
|
def _configured(self) -> bool:
|
|
return bool(os.getenv("KIS_APP_KEY") and os.getenv("KIS_APP_SECRET"))
|
|
|
|
async def quote(self, symbol: str): # type: ignore[no-untyped-def]
|
|
if not self._configured():
|
|
raise ProviderNotConfigured("KIS credentials are not set")
|
|
raise ProviderNotConfigured("KIS client is not wired yet")
|