Skip to content

Commit

Permalink
feat: update fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtham1729 committed Dec 12, 2023
1 parent 4f40999 commit 47089c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
20 changes: 1 addition & 19 deletions applications/data_fetcher/fetcher.py
Original file line number Diff line number Diff line change
@@ -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__)

Expand All @@ -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(
Expand Down
19 changes: 19 additions & 0 deletions applications/data_fetcher/utils/models.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 47089c6

Please sign in to comment.