1
0
personal-data/personal_data/data.py
Jon Michael Aanes 033f0dcf5b
All checks were successful
Build container / Package-Python (push) Successful in 26s
Build container / Package-Container (push) Successful in 1m21s
Ruff check
2024-04-23 23:02:02 +02:00

38 lines
634 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
ONLY_LATEST = 3
@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