investpy.news
ΒΆ
-
investpy.news.
economic_calendar
(time_zone=None, time_filter='time_only', countries=None, importances=None, categories=None, from_date=None, to_date=None)ΒΆ This function retrieves the economic calendar, which covers financial events and indicators from all over the world updated in real-time. By default, the economic calendar of the currrent day from you local timezone will be retrieved, but note that some parameters can be specified so that the economic calendar to retrieve can be filtered.
- Parameters
time_zone (
str
, optional) β time zone in GMT +/- hours:minutes format, which will be the reference time, if None, the local GMT time zone will be used.time_filter (
str
, optional) β it can be time_only or time_remain, so that the calendar will display the time when the event will occurr according to the time zone or the remaining time until an event occurs.countries (
list
ofstr
, optional) β list of countries from where the events of the economic calendar will be retrieved, all contries will be taken into consideration if this parameter is None.importances (
list
ofstr
, optional) β list of importances of the events to be taken into consideration, can contain: high, medium and low; if None all the importance ratings will be taken into consideration including holidays.categories (
list
ofstr
, optional) β list of categories to which the events will be related to, if None all the available categories will be taken into consideration.from_date (
str
, optional) β date from when the economic calendar will be retrieved in dd/mm/yyyy format, if None just current dayβs economic calendar will be retrieved.to_date (
str
, optional) β date until when the economic calendar will be retrieved in dd/mm/yyyy format, if None just current dayβs economic calendar will be retrieved.
- Returns
The resulting
pandas.DataFrame
will contain the retrieved information from the economic calendar with the specified parameters which will include information such as: date, time, zone or country of the event, eventβs title, etc. Note that some of the retrieved fields may be None since Investing.com does not provides that information.- Return type
pandas.DataFrame
- economic_calendar- Raises
ValueError β raised if any of the introduced parameters is not valid or errored.
Examples
>>> data = investpy.economic_calendar() >>> data.head() id date time zone currency importance event actual forecast previous 0 323 27/01/2020 All Day singapore None None Singapore - Chinese New Year None None None 1 9 27/01/2020 All Day hong kong None None Hong Kong - New Year's Day None None None 2 71 27/01/2020 All Day australia None None Australia - Australia Day None None None 3 750 27/01/2020 All Day china None None China - Spring Festival None None None 4 304 27/01/2020 All Day south korea None None South Korea - Market Holiday None None None