alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.65k stars 378 forks source link

Issue with Pulling Certain Categories in Economic Calendar #373

Open justin-rohan opened 3 years ago

justin-rohan commented 3 years ago

Hello, when trying to pull information for certain categories in the economic calendar, it appears as if the filtering does not work. For example, I have found that I cannot filter by Central Bank data (it returns the same thing as when I don't filter by category at all) but can filter by employment data.


>>> data = investpy.economic_calendar(time_zone = "GMT", countries = ["Sweden"], categories = ["centralBanks"], from_date= "1/1/2019", to_date = "31/12/2019")
>>> data.head()
       id        date     time    zone currency importance                                  event actual forecast previous
0       9  01/01/2019  All Day  sweden     None       None                Sweden - New Year's Day   None     None     None
1  378260  02/01/2019    08:30  sweden      SEK        low               Manufacturing PMI  (Dec)   52.0     None     55.4
2  378331  03/01/2019    09:30  sweden      SEK        low  Household Lending Growth (YoY)  (Nov)   5.7%     None     5.8%
3  378431  04/01/2019    08:30  sweden      SEK        low              Services PMI (MoM)  (Dec)   56.4     None     61.1
4  379484  10/01/2019    09:30  sweden      SEK        low            Industrial Production (YoY)   3.4%     None     4.9%
>>> data = investpy.economic_calendar(time_zone = "GMT", countries = ["Sweden"], categories = ["employment"], from_date= "1/1/2019", to_date = "31/12/2019")
>>> data.head()
       id        date     time    zone currency importance                     event actual forecast previous
0       9  01/01/2019  All Day  sweden     None       None   Sweden - New Year's Day   None     None     None
1  379624  14/01/2019    06:00  sweden      SEK        low  Unemployment Rate  (Dec)   7.0%     None     6.9%
2  379423  24/01/2019    09:30  sweden      SEK        low  Unemployment Rate  (Dec)   6.0%     None     5.5%
3  380420  12/02/2019    06:00  sweden      SEK        low  Unemployment Rate  (Jan)   7.0%     None     7.0%
4  381165  14/02/2019    09:30  sweden      SEK        low  Unemployment Rate  (Jan)   6.5%     None     6.0%
>>> data = investpy.economic_calendar(time_zone = "GMT", countries = ["Sweden"], from_date= "1/1/2019", to_date = "31/12/2019")
>>> data.head()
       id        date     time    zone currency importance                                  event actual forecast previous
0       9  01/01/2019  All Day  sweden     None       None                Sweden - New Year's Day   None     None     None
1  378260  02/01/2019    07:30  sweden      SEK        low               Manufacturing PMI  (Dec)   52.0     None     55.4
2  378331  03/01/2019    08:30  sweden      SEK        low  Household Lending Growth (YoY)  (Nov)   5.7%     None     5.8%
3  378431  04/01/2019    07:30  sweden      SEK        low              Services PMI (MoM)  (Dec)   56.4     None     61.1
4  379484  10/01/2019    08:30  sweden      SEK        low            Industrial Production (YoY)   3.4%     None     4.9%
alvarobartt commented 3 years ago

Hi again @justin-rohan, so I guess that the issue you created and closed in #372 was created/closed by mistake and this is the original one I'm assuming.

I'll work on this issue, since the filtering may not be working... :confused:

justin-rohan commented 3 years ago

Hi @alvarobartt you are correct (the other issue was created by mistake).

yokotsumo commented 10 months ago

CATEGORY_FILTERS = { "credit": "_credit", "employment": "_employment", "economic_activity": "_economicActivity", "inflation": "_inflation", "central_banks": "_centralBanks", "confidence": "_confidenceIndex", "balance": "_balance", "bonds": "_Bonds", } the left keywords are orking for me.