It has been a long time since I made a significant update as I was working on the v2.0.0 of the Finance Toolkit featuring numerous improvements to the code as well as major new additions.
Portfolio Functionalities
I've added a brand new class to the Finance Toolkit called `Portfolio` (use `from financetoolkit import Portfolio`) which allows you to load in your own transactions data and see performance over any period of time (as opposed to some benchmark). For a full list of details see [here](https://github.com/JerBouma/FinanceToolkit?tab=readme-ov-file#portfolio-evaluation). Some things that are now possible:
- Load in your own transactions data, based on a custom template that is provided automatically when initializing the class.
- See an overview of your entire portfolio including invested amount, current value, return, benchmark return, alpha, beta and more.
- Explore individual transactions and see how they have contributed to the overall performance of your portfolio. This also allows you to get a breakdown per period whether it be weekly, monthly, quarterly or yearly.
- Delve deeper into how your portfolio performed with daily (cumulative) returns, portfolio weights and more.
As a simple example:

This is however only minor as opposed to the integration with the Finance Toolkit itself meaning that you are able to use all of the 150+ metrics directly with your own portfolio. It also includes a "Portfolio" ticker which represents the weighted sum *over time* of your assets in the portfolio. As an example
python
from financetoolkit import Portfolio
instance = Portfolio(example=True, api_key="FMP_KEY")
profit_margin = instance.toolkit.ratios.get_net_profit_margin()
Which returns when plotted for the Portfolio the following:

This makes it so that you can not only evaluate your portfolio through basic OHLC data but also understand the financial health of the companies you are invested in and how this impacts your overall portfolio.
Caching Capabilities
I've had this request a couple of times now and given the ever-growing size of the project it made sense to integrate caching functionalities. When using `use_cached_data=True` when you initialize the Finance Toolkit any of the core functionalities will automatically be saved to a pickle file (e.g. if you collect a balance sheet statement, these will be saved to the `cached` folder under `balance_sheet_statement.pickle`). If you then re-run the Finance Toolkit you will notice the data collection is instant, this is because the data is loaded from the pickle file.
As an example:
<img width="1000" alt="image" src="https://github.com/user-attachments/assets/943a1cfb-95ad-4455-90f0-0b33dcd7b0df" />
If I wish to receive this data again, I no longer need an API key or set the tickers and can simply keep `use_cached_data=True`.
<img width="1000" alt="image" src="https://github.com/user-attachments/assets/29ef58ca-e208-4c9a-b663-f66b299d3188" />
Please note that it will force the settings as found in the pickle files so if you wish to use a different time period, you will have to recollect.
<img width="1000" alt="image" src="https://github.com/user-attachments/assets/40229dcb-18f0-4e73-8a43-017b1b25d33f" />
You can also change the folder by entering a string instead of a boolean for the `use_cached_data` parameter.
<img width="1000" alt="image" src="https://github.com/user-attachments/assets/a6710d20-55b9-48f1-812e-4ff4fbe06a15" />
Global Macro Database Integration
I've seen the work from Karsten Muller related to the "Global Macro Database" project (see [LinkedIn](https://www.linkedin.com/posts/krstnmllr_global-macro-database-activity-7292566677659992064-UYC_/?utm_source=share&utm_medium=member_desktop&rcm=ACoAABhYAQUBkaNnlBjz_IYBRfaurU68rfoZPE8) and the GitHub project [here](https://github.com/KMueller-Lab/Global-Macro-Database)) which has Economics metrics going back all the way to the 1800s. An invaluable resource which I've integrated into the Finance Toolkit as well. You will see that the [Key Economic Indicators](https://github.com/JerBouma/FinanceToolkit?tab=readme-ov-file#key-economic-indicators) list is therefore greatly expanded.
The current list of Economic parameters is:
- Gross Domestic Product (GDP)
- Total Consumption
- Total Investment
- Total Fixed Investment
- Exports
- Imports
- Current Account Balance
- Government Debt
- Government (Tax) Revenue
- Government Expenditure
- Government Deficit
- Trust in Government
- Consumer Price Index (CPI)
- Inflation Rate
- Consumer Confidence Index (CCI)
- Business Confidence Index (BCI)
- Composite Leading Indicator (CLI)
- House Prices
- Rent Prices
- Share Prices
- Exchange Rates
- Money Supply
- Central Bank Policy Rate
- Long Term Interest Rates (10 year)
- Short Term Interest Rates (3 month)
- Renewable Energy as % of Total Energy
- Carbon Footprint
- Unemployment Rate
- Labour Productivity
- Income Inequality
- Population
- Poverty Rate
Many Bugfixes and Improvements
I've added better error handling for Bandwidth Limits, more information when data is collected from a different source, numerous minor fixes e.g. recalculating ratios found in the financial statements when applying trailing (172 and 173) and cleaned up a lot of other details.
The Streamlit Dashboard is also updated with new additions including a brand new Portfolio Dashboard, see below:
<a href="https://www.jeroenbouma.com/projects/financetoolkit/interactive-dashboard"><img width="1508" alt="image" src="https://github.com/user-attachments/assets/df95ee72-9322-425f-aecb-722b2c7cee23" /></a>