investpy icon indicating copy to clipboard operation
investpy copied to clipboard

Added support for etf extraction by symbol

Open ehcalabres opened this issue 2 years ago • 1 comments

Added support for etf extraction by symbol

As requested on this issue #425, a new feature has been added to the etf information extraction functionalty. Now it's possible to obtain the desired information by either indicating the etf name or symbol.

In order to differentiate wether it is the symbol or the name, a new is_symbol parameter has been added to the functions of etf extraction such get_etf_recent_data(), get_etf_historical_data() and get_etf_information().

As result, the way you can extract the information with name remains unchanged:

import investpy

# Getting etf information by name
data = investpy.get_etf_recent_data('bbva accion dj eurostoxx 50', 'spain')

But if you want to retrieve the information by symbol the resulting method should look like this:

import investpy

# Getting etf information by symbol
data = investpy.get_etf_recent_data('bbvae', 'spain', is_symbol=True)

Note that the is_symbol parameter is optional and its default value is set to False in order to maintain how the previous were used.

All tests for this new functionality has been added to the tests scripts and has been passed without errors.

ehcalabres avatar Jul 16 '21 09:07 ehcalabres

Ah, yeh , maybe https://github.com/alvarobartt/investpy/pull/453 overlaps.

eyalk11 avatar Oct 12 '21 00:10 eyalk11