From a8b0093a08118d7be71111000b27959abc816d1a Mon Sep 17 00:00:00 2001 From: LautaroParada Date: Tue, 4 Jan 2022 17:33:46 +0000 Subject: [PATCH] Implementarion of Economic events api more details of the API in the following link https://eodhistoricaldata.com/financial-apis-blog/new-economic-events-calendar-api/ --- .../economic_events_data_api/__init__.py | 8 ++++++++ .../economic_events_data.py | 18 ++++++++++++++++++ .../fundamental_economic.py | 6 ++++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 eod/fundamental_economic_data/economic_events_data_api/__init__.py create mode 100644 eod/fundamental_economic_data/economic_events_data_api/economic_events_data.py diff --git a/eod/fundamental_economic_data/economic_events_data_api/__init__.py b/eod/fundamental_economic_data/economic_events_data_api/__init__.py new file mode 100644 index 0000000..f3674d8 --- /dev/null +++ b/eod/fundamental_economic_data/economic_events_data_api/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jan 4 16:27:44 2022 + +@author: lauta +""" + +from .economic_events_data import EconomicEventsData \ No newline at end of file diff --git a/eod/fundamental_economic_data/economic_events_data_api/economic_events_data.py b/eod/fundamental_economic_data/economic_events_data_api/economic_events_data.py new file mode 100644 index 0000000..b09eb17 --- /dev/null +++ b/eod/fundamental_economic_data/economic_events_data_api/economic_events_data.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jan 4 16:28:22 2022 + +@author: lauta +""" + +from eod.request_handler_class import RequestHandler + +class EconomicEventsData(RequestHandler): + def __init__(self, api_key:str, timeout:int): + # base URL's of the API + self.URL_ECONOMIC_EVENT_DATA = 'https://eodhistoricaldata.com/api/economic-events/' + super().__init__(api_key, timeout) + + def get_economic_events(self, **query_params): + self.endpoint = self.URL_ECONOMIC_EVENT_DATA + return super().handle_request(self.endpoint, query_params) \ No newline at end of file diff --git a/eod/fundamental_economic_data/fundamental_economic.py b/eod/fundamental_economic_data/fundamental_economic.py index 349fd3c..30abc79 100644 --- a/eod/fundamental_economic_data/fundamental_economic.py +++ b/eod/fundamental_economic_data/fundamental_economic.py @@ -9,12 +9,14 @@ from eod.fundamental_economic_data.calendar_earnings_trends_ipos_splits_api import CalendarEarningsTrendsIposSplits from eod.fundamental_economic_data.macroeconomic_api import MacroEconomicIndicators from eod.fundamental_economic_data.insider_transactions_api import InsiderTransactions +from eod.fundamental_economic_data.economic_events_data_api import EconomicEventsData class FundamentalEconomicData(StockEtfFundsIndexFundamentalData, CalendarEarningsTrendsIposSplits, - MacroEconomicIndicators, InsiderTransactions): + MacroEconomicIndicators, InsiderTransactions, EconomicEventsData): def __init__(self, api_key:str, timeout:int): # inhereting the API classes StockEtfFundsIndexFundamentalData.__init__(self, api_key, timeout) CalendarEarningsTrendsIposSplits.__init__(self, api_key, timeout) MacroEconomicIndicators.__init__(self, api_key, timeout) - InsiderTransactions.__init__(self, api_key, timeout) \ No newline at end of file + InsiderTransactions.__init__(self, api_key, timeout) + EconomicEventsData.__init__(self, api_key, timeout) \ No newline at end of file