Created
October 23, 2019 12:47
-
-
Save alvarobartt/0c8c690c8bc5e0c8bb535bd3c178b7e8 to your computer and use it in GitHub Desktop.
This is a sample on investpy usage when it comes to stock data retrieval, as current release is 0.9.7.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import investpy | |
print(investpy.__author__, investpy.__version__) | |
# Retrieve a `pandas.DataFrame` containing all the Stocks from United States | |
stocks = investpy.get_stocks(country='united states') | |
# Retrieve historical data from AAPL | |
df = investpy.get_stock_historical_data(stock='AAPL', # Stock symbol of the stock to retrieve data from | |
country='united states', # Country from where the introduced stock is from | |
from_date='01/01/2010', # Date since data is going to be retrieved formatted as dd/mm/yyyy | |
to_date='01/01/2019' # Date until data is going to be retrieved formatted as dd/mm/yyyy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment