base.py 399 B

12345678910111213141516171819
  1. from abc import ABC, abstractmethod
  2. class EventProcessorBase(ABC):
  3. @abstractmethod
  4. def should_run(self) -> bool:
  5. return False
  6. @abstractmethod
  7. def transform(self):
  8. return self.data
  9. def __init__(self, release_id, data):
  10. self.release_id = release_id
  11. self.data = data
  12. def run(self):
  13. if self.should_run():
  14. self.transform()