Skip to content

Commit

Permalink
Ignored not found parameters file
Browse files Browse the repository at this point in the history
  • Loading branch information
wleong1 committed Mar 7, 2024
1 parent 8c24a11 commit d88e61b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/live_price_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from typing import Union, Any
import requests
import yfinance as yf # type: ignore[import-untyped] # pylint: disable=E0401
import yfinance as yf # type: ignore[import-untyped] # pylint: disable=E0401
import pandas as pd

from src.parameters import ALPHA_VANTAGE_API_KEY # type: ignore[import-not-found] # pylint: disable=E0401, E0611
from src.parameters import ALPHA_VANTAGE_API_KEY # type: ignore[import-not-found] # pylint: disable=E0401, E0611

ALPHA_VANTAGE_ENDPOINT = "https://www.alphavantage.co/query"

Expand Down Expand Up @@ -34,8 +34,7 @@ def display_final_price_av(company_name: str) -> Union[str, dict, Any]:
"symbol": company_name,
}
price_response: requests.models.Response = requests.get(
ALPHA_VANTAGE_ENDPOINT, params=price_params,
timeout=20
ALPHA_VANTAGE_ENDPOINT, params=price_params, timeout=20
)
if price_response.ok:
response_data: dict = price_response.json()
Expand Down
5 changes: 2 additions & 3 deletions src/news_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests

from src.parameters import NEWS_API_KEY # type: ignore[import-untyped] # pylint: disable=E0401, E0611
from src.parameters import NEWS_API_KEY # type: ignore[import-not-found] # type: ignore[import-untyped] # pylint: disable=E0401, E0611, C0301

NEWS_ENDPOINT = "https://newsapi.org/v2/everything"

Expand All @@ -25,8 +25,7 @@ def _collect_news(company_name: str) -> list:
news_params: dict = {"apiKey": NEWS_API_KEY, "qInTitle": company_name}

news_response: requests.models.Response = requests.get(
NEWS_ENDPOINT, params=news_params,
timeout=20
NEWS_ENDPOINT, params=news_params, timeout=20
)
articles: list = news_response.json()["articles"]
five_articles: list = articles[:5]
Expand Down

0 comments on commit d88e61b

Please sign in to comment.