File size: 496 Bytes
1cd137c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from abc import ABC, abstractmethod
from collections.abc import Iterator
class RetailerAdapter(ABC):
"""Common interface for all retailer data sources."""
@property
@abstractmethod
def retailer(self) -> str:
"""Return the retailer name."""
@abstractmethod
def products(self) -> Iterator[dict]:
"""Yield standardized product records."""
@abstractmethod
def nutrition(self) -> Iterator[dict]:
"""Yield standardized nutrition records."""
|