31 lines
725 B
Python
31 lines
725 B
Python
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
from datetime import datetime
|
|
|
|
import pandas as pd
|
|
|
|
|
|
class MarketDataProvider(ABC):
|
|
@property
|
|
@abstractmethod
|
|
def provider_name(self) -> str:
|
|
raise NotImplementedError
|
|
|
|
@property
|
|
@abstractmethod
|
|
def channel(self) -> str:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def fetch_spot(self) -> pd.DataFrame:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def search_spot(self, query: str, limit: int) -> pd.DataFrame:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def fetch_daily_kline(self, code: str, start: datetime, end: datetime) -> pd.DataFrame:
|
|
raise NotImplementedError
|