diff --git a/applications/data_fetcher/fetcher.py b/applications/data_fetcher/fetcher.py index 44505d8..366ae78 100644 --- a/applications/data_fetcher/fetcher.py +++ b/applications/data_fetcher/fetcher.py @@ -1,11 +1,11 @@ import os -from dataclasses import dataclass from datetime import datetime from typing import Dict, List import psycopg import requests from utils.logging import get_logger +from utils.models import News, Ticker logger = get_logger(__name__) @@ -19,24 +19,6 @@ MAX_API_QUERIES = 100 -@dataclass -class Ticker: - ticker: str - - -@dataclass -class News: - category: str - symbol: str - src: str - src_url: str - img_src_url: str - headline: str - summary: str - publish_time: str - sentiment: str - - class Fetcher: def __init__(self): self.connection = psycopg.connect( diff --git a/applications/data_fetcher/utils/models.py b/applications/data_fetcher/utils/models.py new file mode 100644 index 0000000..3bec960 --- /dev/null +++ b/applications/data_fetcher/utils/models.py @@ -0,0 +1,19 @@ +from dataclasses import dataclass + + +@dataclass +class Ticker: + ticker: str + + +@dataclass +class News: + category: str + symbol: str + src: str + src_url: str + img_src_url: str + headline: str + summary: str + publish_time: str + sentiment: int