I've added in the **Dividend Calendar** which can be shown by `get_dividend_calendar()`:
from financetoolkit import Toolkit
API_KEY = "FINANCIAL_MODELING_PREP_KEY"
Initialize the Toolkit with company tickers
companies = Toolkit(
["AAPL", "MSFT", "GOOGL", "AMZN"], api_key=API_KEY, start_date="2005-01-01"
)
companies.get_dividend_calendar()
Which returns:
<img width="511" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/47bf0d2e-7f9c-44aa-bd33-142ad62ad712">
**Next to that, this release introduces historical data from FinancialModelingPrep.** This is enabled by default when you provide an API key but can be changed back by setting `historical_source` to `"YahooFinance"` when initialising the Toolkit. When you don't provide an API key it defaults to Yahoo Finance.
**This is done to prevent rate limits from becoming an issue when you have purchased a [FinancialModelingPrep subscription](https://intelligence.financialmodelingprep.com/pricing-plans?couponCode=jeroen) given that Yahoo Finance will rate limit at some point. It of course makes little sense that you are paying and still get rate limited!**
E.g. the following will net you the same result:
from financetoolkit import Toolkit
API_KEY = "FINANCIAL_MODELING_PREP_KEY"
Use FinancialModelingPrep to obtain Historical Data
companies = Toolkit(
["AAPL", "MSFT", "GOOGL", "AMZN"], api_key=API_KEY, start_date="2005-01-01"
)
companies.get_historical_data()
Use Yahoo Finance to obtain Historical Data even though you set a FinancialModelingPrep API Key
companies = Toolkit(
["AAPL", "MSFT", "GOOGL", "AMZN"], api_key=API_KEY, start_date="2005-01-01", historical_source='YahooFinance'
)
companies.get_historical_data()
Use Yahoo Finance to obtain Historical Data without needing to set an API Key
companies = Toolkit(
["AAPL", "MSFT", "GOOGL", "AMZN"], start_date="2005-01-01"
)
companies.get_historical_data()
Which returns:
<img width="686" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/71e4410d-cc3c-426b-892c-392740980112">