1
0
personal-data/personal_data/data.py
2024-03-03 17:25:34 +01:00

35 lines
614 B
Python

import dataclasses
import requests
from enum import Enum
import abc
class DeduplicateMode(Enum):
NONE = 0
BY_FIRST_COLUMN = 1
BY_ALL_COLUMNS = 2
@dataclasses.dataclass(frozen = True)
class Scraper(abc.ABC):
session: requests.Session
@staticmethod
def dataset_name() -> str:
pass
@staticmethod
def deduplicate_mode() -> DeduplicateMode:
pass
@staticmethod
def dataset_format() -> str:
return 'list-of-dicts'
@staticmethod
def requires_cfscrape() -> bool:
return False
@abc.abstractmethod
def scrape(self):
pass