SERPent2 / scrap /base.py
Game4all's picture
Initial commit
d907837
from abc import abstractmethod
from httpx import AsyncClient
from pydantic import BaseModel
class ScrapperBackendBase(BaseModel):
"""Base class for a source scrapper"""
@property
@abstractmethod
def content_type(self) -> str:
"""Type of content that this backend can scrap. Used to determine what scrap backend to use to scrap full contents."""
pass
@abstractmethod
async def scrap(self, client: AsyncClient, id: str) -> dict:
pass