Skip to content

Commit

Permalink
Merge pull request #16 from LautaroParada/fundamental-econnomical-api
Browse files Browse the repository at this point in the history
Implementarion of Economic events api
  • Loading branch information
LautaroParada authored Jan 4, 2022
2 parents 023684d + a8b0093 commit e849908
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 4 16:27:44 2022
@author: lauta
"""

from .economic_events_data import EconomicEventsData
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 4 additions & 2 deletions eod/fundamental_economic_data/fundamental_economic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
InsiderTransactions.__init__(self, api_key, timeout)
EconomicEventsData.__init__(self, api_key, timeout)

0 comments on commit e849908

Please sign in to comment.