phase6: add provider abstraction, mvp adapter, and ingestion sync tasks

This commit is contained in:
Alfredo Di Stasio
2026-03-10 11:05:57 +01:00
parent f207ffbad8
commit ecd665e872
12 changed files with 1006 additions and 1 deletions

View File

@ -0,0 +1,45 @@
from abc import ABC, abstractmethod
class BaseProviderAdapter(ABC):
namespace: str
@abstractmethod
def search_players(self, *, query: str = "", limit: int = 50, offset: int = 0) -> list[dict]:
raise NotImplementedError
@abstractmethod
def fetch_player(self, *, external_player_id: str) -> dict | None:
raise NotImplementedError
@abstractmethod
def fetch_players(self) -> list[dict]:
raise NotImplementedError
@abstractmethod
def fetch_competitions(self) -> list[dict]:
raise NotImplementedError
@abstractmethod
def fetch_teams(self) -> list[dict]:
raise NotImplementedError
@abstractmethod
def fetch_seasons(self) -> list[dict]:
raise NotImplementedError
@abstractmethod
def fetch_player_stats(self) -> list[dict]:
raise NotImplementedError
@abstractmethod
def fetch_player_careers(self) -> list[dict]:
raise NotImplementedError
@abstractmethod
def sync_all(self) -> dict:
raise NotImplementedError
@abstractmethod
def sync_incremental(self, *, cursor: str | None = None) -> dict:
raise NotImplementedError