1
0
personal-data/personal_data/data.py
Jon Michael Aanes 6d3a8fd56e
Some checks failed
Python Package / Package (push) Failing after 17s
Ruff format
2024-04-01 00:56:24 +02:00

37 lines
614 B
Python

import abc
import dataclasses
from enum import Enum
import requests
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