financetoolkit 2.2.0__tar.gz → 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/PKG-INFO +25 -25
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/README.md +23 -23
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/cache_controller.py +27 -1
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/frame_model.py +5 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/discovery/discovery_controller.py +5 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/diagnostics_model.py +12 -7
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/econometrics_controller.py +782 -303
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/forecast_evaluation_model.py +4 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/panel_data_model.py +8 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/regression_model.py +9 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/unitroot_model.py +8 -3
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/economics/economics_controller.py +1 -1
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/economics/gmdb_model.py +8 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/economics/oecd_model.py +30 -3
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/economics/yfinance_model.py +4 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/fixedincome_controller.py +38 -32
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/fmp_model.py +12 -11
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/fred_model.py +8 -16
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fmp_model.py +163 -252
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fundamentals_model.py +77 -52
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/helpers.py +87 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/historical_model.py +58 -60
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/config.yaml +5 -3
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcp_controller.py +18 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcpb/manifest.json +3 -3
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcpb/pyproject.toml +2 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/provider_model.py +76 -34
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/registry_controller.py +38 -13
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/enterprise_model.py +14 -13
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/fulmer_model.py +6 -1
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/growth_model.py +3 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/helpers.py +4 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/intrinsic_model.py +3 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/models_controller.py +58 -61
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/ohlson_model.py +6 -1
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/piotroski_model.py +83 -94
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/wacc_model.py +9 -7
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization_model.py +27 -7
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/binomial_trees_model.py +17 -8
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/black_scholes_model.py +16 -15
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/helpers.py +13 -10
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/options_controller.py +28 -23
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/options_model.py +1 -1
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/performance/helpers.py +22 -11
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/performance/performance_controller.py +228 -271
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/performance/performance_model.py +45 -25
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/overview_model.py +5 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/portfolio_controller.py +19 -13
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/portfolio_model.py +10 -10
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/ratios/efficiency_model.py +56 -56
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/ratios/liquidity_model.py +29 -25
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/ratios/profitability_model.py +72 -58
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/ratios/ratios_controller.py +125 -116
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/ratios/solvency_model.py +47 -44
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/ratios/valuation_model.py +87 -76
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/backtesting_model.py +5 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/cvar_model.py +6 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/garch_model.py +9 -9
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/helpers.py +13 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/market_liquidity_model.py +1 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/realized_volatility_model.py +2 -1
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/risk_controller.py +494 -286
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/risk_model.py +9 -8
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/var_model.py +7 -5
- financetoolkit-2.2.1/financetoolkit/technicals/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/technicals/breadth_model.py +12 -5
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/technicals/momentum_model.py +3 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/technicals/technicals_controller.py +18 -15
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/technicals/volatility_model.py +1 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/toolkit_controller.py +18 -88
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/utilities/dataframe_model.py +86 -4
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/utilities/requests_model.py +36 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/utilities/statistics_model.py +81 -4
- financetoolkit-2.2.1/financetoolkit/utilities/validation_model.py +153 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/yfinance_model.py +8 -2
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/pyproject.toml +18 -10
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/.gitignore +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/LICENSE.txt +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/coverage_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/policy_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/request_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/serialization_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/sqlite_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/cache/ticker_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/currencies_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/discovery/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/discovery/discovery_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/causal_inference_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/causality_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/cointegration_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/event_study_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/fama_macbeth_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/hypothesis_testing_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/specification_tests_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/econometrics/time_series_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/economics/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/economics/fred_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/bond_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/derivative_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/ecb_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/euribor_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/fed_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/helpers.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/fixedincome/yieldcurve_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/__main__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/auth_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/coercion_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/formatting_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/inspection_controller.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcpb/.mcpbignore +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcpb/LICENSE +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcpb/README.md +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcpb/build-mcpb.sh +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/mcpb/finance_toolkit_icon.png +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/setup_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/mcp_server/tools_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/altman_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/beneish_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/dupont_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/eva_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/grover_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/springate_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/models/zmijewski_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/balance.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/balance_yf.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/cash.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/cash_yf.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/income.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/income_yf.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/statistics.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/normalization/statistics_yf.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/exotics_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/greeks_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/risk_neutral_density_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/options/svi_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/performance/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/config.yaml +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/example_datasets/example_portfolio.csv +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/example_datasets/example_portfolio.xlsx +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/portfolio/helpers.py +0 -0
- /financetoolkit-2.2.0/financetoolkit/ratios/__init__.py → /financetoolkit-2.2.1/financetoolkit/py.typed +0 -0
- {financetoolkit-2.2.0/financetoolkit/risk → financetoolkit-2.2.1/financetoolkit/ratios}/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/ratios/helpers.py +0 -0
- {financetoolkit-2.2.0/financetoolkit/technicals → financetoolkit-2.2.1/financetoolkit/risk}/__init__.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/copula_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/covar_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/risk/evar_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/technicals/helpers.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/technicals/overlap_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/utilities/error_model.py +0 -0
- {financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/utilities/logger_model.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: financetoolkit
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Transparent and Efficient Financial Analysis
|
|
5
5
|
Author: Jeroen Bouma
|
|
6
6
|
License: MIT
|
|
@@ -29,7 +29,7 @@ Requires-Dist: statsmodels>=0.14; extra == 'econometrics'
|
|
|
29
29
|
Provides-Extra: mcp
|
|
30
30
|
Requires-Dist: fastmcp>=3.4.2; extra == 'mcp'
|
|
31
31
|
Requires-Dist: linearmodels>=6.0; extra == 'mcp'
|
|
32
|
-
Requires-Dist: mcp[cli]
|
|
32
|
+
Requires-Dist: mcp[cli]<2,>=1.27.0; extra == 'mcp'
|
|
33
33
|
Requires-Dist: python-dotenv>=1.0; extra == 'mcp'
|
|
34
34
|
Requires-Dist: rich>=13.0; extra == 'mcp'
|
|
35
35
|
Requires-Dist: statsmodels>=0.14; extra == 'mcp'
|
|
@@ -174,12 +174,12 @@ Which returns:
|
|
|
174
174
|
| SAF.PA | Safran SA | 66234006559 | Industrials | Aerospace & Defense | 1.339 | 160.16 | 1.35 | Paris | FR |
|
|
175
175
|
| ROST | Ross Stores, Inc. | 46724188589 | Consumer Cyclical | Apparel Retail | 1.026 | 138.785 | 1.34 | NASDAQ Global Select | US |
|
|
176
176
|
|
|
177
|
-
Furthermore, you can find in this module [stock screeners](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery
|
|
177
|
+
Furthermore, you can find in this module [stock screeners](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery/stock-screener), [sector/industry performance](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery/sector-performance) and [news feeds](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery/stock-market-news) and more. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/discovery-notebook) and the full instrument discovery documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery).**
|
|
178
178
|
|
|
179
179
|
|
|
180
180
|
### Obtaining Historical Data
|
|
181
181
|
|
|
182
|
-
Obtain [historical data](https://www.jeroenbouma.com/projects/financetoolkit/docs
|
|
182
|
+
Obtain [historical data](https://www.jeroenbouma.com/projects/financetoolkit/docs/historical-data) on a daily, weekly, monthly or yearly basis. This includes OHLC, volumes, dividends, returns and cumulative returns for each corresponding period.
|
|
183
183
|
|
|
184
184
|
```python
|
|
185
185
|
# Obtain historical market data for all tickers
|
|
@@ -203,11 +203,11 @@ And below the cumulative returns are plotted which include the S&P 500 as benchm
|
|
|
203
203
|
|
|
204
204
|

|
|
205
205
|
|
|
206
|
-
Metrics such as `Volatility`, `Excess Return` and `Excess Volatility` are calculated as dedicated [Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk
|
|
206
|
+
Metrics such as `Volatility`, `Excess Return` and `Excess Volatility` are calculated as dedicated [Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/volatility) and [Performance](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/excess-return) methods rather than columns on this table to create more efficient and flexible functionalities. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/getting-started) and the full historical data documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/historical-data).**
|
|
207
207
|
|
|
208
208
|
### Obtaining Financial Statements
|
|
209
209
|
|
|
210
|
-
Obtain an [Income Statement](https://www.jeroenbouma.com/projects/financetoolkit/docs
|
|
210
|
+
Obtain an [Income Statement](https://www.jeroenbouma.com/projects/financetoolkit/docs/income-statements) on an annual or quarterly basis. This can also be a [balance statement](https://www.jeroenbouma.com/projects/financetoolkit/docs/balance-sheet-statements) or [cash flow statement](https://www.jeroenbouma.com/projects/financetoolkit/docs/cash-flow-statements).
|
|
211
211
|
|
|
212
212
|
```python
|
|
213
213
|
# Obtain the Income Statement for all tickers
|
|
@@ -233,7 +233,7 @@ And below the Earnings Before Interest, Taxes, Depreciation and Amortization (EB
|
|
|
233
233
|
|
|
234
234
|
### Obtaining Financial Ratios
|
|
235
235
|
|
|
236
|
-
Get [Profitability Ratios](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios
|
|
236
|
+
Get [Profitability Ratios](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-profitability-ratios) based on the inputted balance sheet, income and cash flow statements. This can be any of the 80+ ratios within the `ratios` module.
|
|
237
237
|
|
|
238
238
|
```python
|
|
239
239
|
# Collect all Profitability Ratios for all tickers
|
|
@@ -257,11 +257,11 @@ And below a few of the profitability ratios are plotted for Microsoft.
|
|
|
257
257
|
|
|
258
258
|

|
|
259
259
|
|
|
260
|
-
The 80+ ratios are divided into five categories: [**Efficiency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios
|
|
260
|
+
The 80+ ratios are divided into five categories: [**Efficiency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-efficiency-ratios) (asset/inventory/receivables turnover, cash conversion cycle, R&D/SG&A/SBC-to-revenue), [**Liquidity**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-liquidity-ratios) (current, quick and cash ratios, working capital), [**Profitability**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-profitability-ratios) (margins, ROE/ROA/ROIC, cash vs. effective tax rate), [**Solvency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-solvency-ratios) (debt-to-equity, debt-to-capital, interest and dividend coverage) and [**Valuation**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-valuation-ratios) (P/E, PEG, Forward P/E, EV multiples, buyback and shareholder yield). It's also possible to define fully [custom ratios](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/custom-ratios) calculated automatically from the balance sheet, income and cash flow statements. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/ratios-notebook) and the full ratio-by-ratio documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios).**
|
|
261
261
|
|
|
262
262
|
### Obtaining Financial Models
|
|
263
263
|
|
|
264
|
-
Get an [Extended DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models
|
|
264
|
+
Get an [Extended DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/extended-dupont-analysis) based on the inputted balance sheet, income and cash flow statements.
|
|
265
265
|
|
|
266
266
|
```python
|
|
267
267
|
# Get the Extended DuPont Analysis for all tickers
|
|
@@ -286,11 +286,11 @@ And below each component of the Extended Dupont Analysis is plotted including th
|
|
|
286
286
|
|
|
287
287
|

|
|
288
288
|
|
|
289
|
-
The `models` module covers 10+ models in total, for example [DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models
|
|
289
|
+
The `models` module covers 10+ models in total, for example [DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/dupont-analysis), [WACC](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/weighted-average-cost-of-capital-wacc), [Economic Value Added (EVA)](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/economic-value-added-eva), [Altman Z-Score](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/altman-z-score), [Beneish M-Score](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/beneish-m-score) and the [Graham Number](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/graham-number). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/models-notebook) and the full model-by-model documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/models).**
|
|
290
290
|
|
|
291
291
|
### Obtaining Options and Greeks
|
|
292
292
|
|
|
293
|
-
Get the [Black Scholes Model](https://www.jeroenbouma.com/projects/financetoolkit/docs/options
|
|
293
|
+
Get the [Black Scholes Model](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/black-scholes-model) for both call and put options including the relevant Greeks, in this case [Delta](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/delta), [Gamma](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/gamma), [Theta](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/theta) and [Vega](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/vega). This can be any of the First, Second or Third Order Greeks.
|
|
294
294
|
|
|
295
295
|
```python
|
|
296
296
|
# Get Delta for all tickers across strikes and expirations
|
|
@@ -314,11 +314,11 @@ Which can also be plotted together with Gamma, Theta and Vega as follows:
|
|
|
314
314
|
|
|
315
315
|

|
|
316
316
|
|
|
317
|
-
The `options` module is divided into four categories: [**Option Pricing**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options
|
|
317
|
+
The `options` module is divided into four categories: [**Option Pricing**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/black-scholes-model) (Black-Scholes, Binomial Model, Implied Volatility), [**First-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/first-order-greeks) (Delta, Vega, Theta, Rho), [**Second-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/second-order-greeks) (Gamma, Vanna, Charm, Vomma) and [**Third-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/third-order-greeks) (Speed, Zomma, Color, Ultima). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/options-notebook) and the full option pricing and Greeks documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/options).**
|
|
318
318
|
|
|
319
319
|
### Obtaining Performance Metrics
|
|
320
320
|
|
|
321
|
-
Get the correlations with the [factors as defined by Fama-and-French](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance
|
|
321
|
+
Get the correlations with the [factors as defined by Fama-and-French](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/factor-asset-correlations). These include market, size, value, operating profitability and investment. The beauty of all functionality here is that it can be based on any period as the function accepts the period `intraday`, `weekly`, `monthly`, `quarterly` and `yearly`.
|
|
322
322
|
|
|
323
323
|
```python
|
|
324
324
|
# Get the Fama-French factor correlations for all tickers, quarterly
|
|
@@ -342,11 +342,11 @@ And below the correlations with each factor are plotted over time for both Apple
|
|
|
342
342
|
|
|
343
343
|

|
|
344
344
|
|
|
345
|
-
Beyond Beta, CAPM and the Fama-French factors, the `performance` module covers around 20+ metrics in total, for example [Sharpe Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance
|
|
345
|
+
Beyond Beta, CAPM and the Fama-French factors, the `performance` module covers around 20+ metrics in total, for example [Sharpe Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/sharpe-ratio), [Sortino Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/sortino-ratio), [Calmar Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/calmar-ratio), [Omega Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/omega-ratio) and the [Correlation Matrix](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/correlation-matrix). Most of these also support `rolling=<n>` for a value that evolves through time instead of one number per period. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/performance-notebook) and the full performance metric documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance).**
|
|
346
346
|
|
|
347
347
|
### Obtaining Risk Metrics
|
|
348
348
|
|
|
349
|
-
Get the [Value at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk
|
|
349
|
+
Get the [Value at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/value-at-risk-var) for each week. Here, the days within each week are considered for the Value at Risk. This makes it so that you can understand within each period what is the expected Value at Risk (VaR) which can again be any period but also based on distributions such as Historical, Gaussian, Student-t, Cornish-Fisher, or a Peak-over-Threshold Extreme Value Theory (`distribution="evt"`) fit for the tail.
|
|
350
350
|
|
|
351
351
|
```python
|
|
352
352
|
# Get the weekly Value at Risk for all tickers
|
|
@@ -365,11 +365,11 @@ And below the Value at Risk (VaR) for Apple, Microsoft and the benchmark (S&P 50
|
|
|
365
365
|
|
|
366
366
|

|
|
367
367
|
|
|
368
|
-
Beyond VaR/CVaR/Entropic VaR, the `risk` module covers around 20+ metrics in total, for example [Conditional Drawdown at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk
|
|
368
|
+
Beyond VaR/CVaR/Entropic VaR, the `risk` module covers around 20+ metrics in total, for example [Conditional Drawdown at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/conditional-drawdown-at-risk-cdar), [Maximum Drawdown Duration](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/maximum-drawdown-duration), [EWMA Volatility](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/ewma-volatility) and the [Hurst Exponent](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/hurst-exponent). Most of these support `rolling=<n>` for a value that evolves through time instead of one number per period. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/risk-notebook) and the full risk metric documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk).**
|
|
369
369
|
|
|
370
370
|
### Obtaining Technical Indicators
|
|
371
371
|
|
|
372
|
-
Get the [Ichimoku Cloud](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals
|
|
372
|
+
Get the [Ichimoku Cloud](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/ichimoku-cloud) parameters based on the historical market data. This can be any of the 40+ technical indicators within the `technicals` module.
|
|
373
373
|
|
|
374
374
|
```python
|
|
375
375
|
# Get the Ichimoku Cloud for all tickers
|
|
@@ -393,11 +393,11 @@ And below the Ichimoku Cloud parameters are plotted for Apple and Microsoft side
|
|
|
393
393
|
|
|
394
394
|

|
|
395
395
|
|
|
396
|
-
The 40+ indicators are divided into four categories: [**Breadth**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals
|
|
396
|
+
The 40+ indicators are divided into four categories: [**Breadth**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-breadth-indicators) (McClellan Oscillator, Advancers/Decliners, OBV, ADL, Chaikin Oscillator, TRIN, New Highs - New Lows), [**Momentum**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-momentum-indicators) (RSI, MACD, Stochastic, Williams %R, Aroon, CCI, ADX and more), [**Overlap**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-overlap-indicators) (SMA, EMA, DEMA, TRIX, WMA, Hull MA, VWAP, Parabolic SAR, Pivot Points, Support/Resistance) and [**Volatility**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-volatility-indicators) (ATR, Keltner Channels, Bollinger Bands, Donchian Channels, Volatility Cone). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/technicals-notebook) and the full technical indicator documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals).**
|
|
397
397
|
|
|
398
398
|
### Obtaining Fixed Income Metrics
|
|
399
399
|
|
|
400
|
-
Get access to the [ICE BofA Corporate Bond](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome
|
|
400
|
+
Get access to the [ICE BofA Corporate Bond](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/effective-yield) benchmark indices and a variety of other bond and derivative related valuations within the `fixedincome` module.
|
|
401
401
|
|
|
402
402
|
```python
|
|
403
403
|
# Get the ICE BofA Effective Yield for each Credit Rating
|
|
@@ -418,11 +418,11 @@ And below a variety of Fixed Income metrics are shown all acquired from the Fixe
|
|
|
418
418
|
|
|
419
419
|

|
|
420
420
|
|
|
421
|
-
Beyond ICE BofA benchmarks, the `fixedincome` module covers [**Bond Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome
|
|
421
|
+
Beyond ICE BofA benchmarks, the `fixedincome` module covers [**Bond Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/general-statistics) (Present Value, Macaulay/Modified Duration, Convexity, Yield to Maturity), [**Derivative Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/black-model) (Black and Bachelier models for Swaptions), [**Government Bonds**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/3-month-government-bond-yield) (3-month and 10-year yields) and **Central Bank rates** ([Euribor](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/euro-interbank-offered-rate-euribor), [ECB](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/main-refinancing-operations-ecb) and [Federal Reserve rates](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/secured-overnight-financing-rate-sofr) incl. SOFR). It can be called via `companies.fixedincome` or standalone through `from financetoolkit import FixedIncome`. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/fixed-income-notebook) and the full fixed income documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome).**
|
|
422
422
|
|
|
423
423
|
### Understanding Key Economic Indicators
|
|
424
424
|
|
|
425
|
-
Get insights for 60+ countries into key economic indicators such as the [Consumer Price Index (CPI)](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics
|
|
425
|
+
Get insights for 60+ countries into key economic indicators such as the [Consumer Price Index (CPI)](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/consumer-price-index), [Gross Domestic Product (GDP)](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/gross-domestic-product-gdp), [Unemployment Rates](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/unemployment-rates) and [3-month](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/short-term-interest-rate) and [10-year](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/long-term-interest-rate) Government Interest Rates. This is done through the `economics` module and can be used as a standalone module as well by using `from financetoolkit import Economics`.
|
|
426
426
|
|
|
427
427
|
```python
|
|
428
428
|
# Get the Unemployment Rate for a selection of countries
|
|
@@ -444,7 +444,7 @@ And below these Unemployment Rates are plotted over time:
|
|
|
444
444
|
|
|
445
445
|

|
|
446
446
|
|
|
447
|
-
The 40+ indicators are divided into five categories: [**Government**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics
|
|
447
|
+
The 40+ indicators are divided into five categories: [**Government**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/government-debt) (GDP, government debt/revenue/expenditure/deficit, trust in government), [**Economy**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/consumer-price-index) (CPI, inflation, consumer/business confidence, house/rent/share prices), [**Finance**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/money-supply) (money supply, central bank policy rate, short/long-term interest rates), [**Environment**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/renewable-energy) (renewable energy, carbon footprint) and [**Jobs & Society**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/unemployment-rates) (unemployment, labour productivity, income inequality, population, poverty rate). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/economics-notebook) and the full economic indicator documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics).**
|
|
448
448
|
|
|
449
449
|
### Explore your own Portfolio
|
|
450
450
|
|
|
@@ -483,7 +483,7 @@ In which the weights and returns can be depicted as follows:
|
|
|
483
483
|
|
|
484
484
|
### Applying Econometric Techniques
|
|
485
485
|
|
|
486
|
-
The `econometrics` module provides [regression](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics
|
|
486
|
+
The `econometrics` module provides [regression](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/ordinary-least-squares-ols), [hypothesis testing](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/jarque-bera-test), [unit root and cointegration](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/augmented-dickey-fuller-adf), [Granger causality](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/granger-causality) and [panel data](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/fixed-effects) methods built on `statsmodels` and `linearmodels`. It requires the optional `financetoolkit[econometrics]` extra (`pip install financetoolkit[econometrics]`) and can be used via `companies.econometrics`.
|
|
487
487
|
|
|
488
488
|
```python
|
|
489
489
|
# AAPL is the Toolkit's first ticker, so it's the default dependent ticker;
|
|
@@ -507,7 +507,7 @@ Regressing Apple's returns on a mix of its chip suppliers, megacap peers and two
|
|
|
507
507
|
| XOM | -0.0291 | 0.0373 | -0.7799 | 0.4364 |
|
|
508
508
|
| PG | 0.2858 | 0.0707 | 4.0393 | 0.0001 |
|
|
509
509
|
|
|
510
|
-
Only `QCOM`, `SWKS`, `MSFT` and `GOOGL` come out statistically significant once every regressor is controlled for at once. The `econometrics` module covers 48 methods in total, including [unit root tests](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics
|
|
510
|
+
Only `QCOM`, `SWKS`, `MSFT` and `GOOGL` come out statistically significant once every regressor is controlled for at once. The `econometrics` module covers 48 methods in total, including [unit root tests](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/augmented-dickey-fuller-adf) (ADF, KPSS, Phillips-Perron), [cointegration and Granger causality](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/engle-granger-cointegration), [panel data estimators](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/fixed-effects) (Fixed/Random Effects), [causal inference](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/propensity-score-matching-psm) (IV-2SLS, Difference-in-Differences, Regression Discontinuity, Propensity Score Matching, Synthetic Control) and [time-series forecasting](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/arima-forecast) (ARIMA, VAR, VECM). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/econometrics-notebook) and the full econometrics documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics).**
|
|
511
511
|
|
|
512
512
|
# MCP Server
|
|
513
513
|
|
|
@@ -610,7 +610,7 @@ This is related to the `benchmark_ticker` parameter which is set to "SPY" (S&P 5
|
|
|
610
610
|
|
|
611
611
|
> **Data collection seems to be slow, what could be the issue?**
|
|
612
612
|
|
|
613
|
-
Generally, it should take less than 15 seconds to retrieve the historical data of 100 tickers. If it takes much longer, this could be due to reaching the API limit (the Starter plan has 250 requests per minute), due to a slow internet connection or due to unoptimized code.
|
|
613
|
+
Generally, it should take less than 15 seconds to retrieve the historical data of 100 tickers. If it takes much longer, this could be due to reaching the API limit (the Starter plan has 250 requests per minute), due to a slow internet connection or due to unoptimized code. The Finance Toolkit collects data with a bounded pool of worker threads (10 by default, configurable through the `FINANCETOOLKIT_MAX_WORKERS` environment variable) over a shared connection, so it is recommended to initialize the Toolkit with all tickers you want to analyze at once rather than one at a time. If it is taking 10+ minutes consider having a look at [this issue](https://github.com/JerBouma/FinanceToolkit/issues/99#issuecomment-1889726000) that managed to resolve the problem.
|
|
614
614
|
|
|
615
615
|
> **Are you part of FinancialModelingPrep?**
|
|
616
616
|
|
|
@@ -136,12 +136,12 @@ Which returns:
|
|
|
136
136
|
| SAF.PA | Safran SA | 66234006559 | Industrials | Aerospace & Defense | 1.339 | 160.16 | 1.35 | Paris | FR |
|
|
137
137
|
| ROST | Ross Stores, Inc. | 46724188589 | Consumer Cyclical | Apparel Retail | 1.026 | 138.785 | 1.34 | NASDAQ Global Select | US |
|
|
138
138
|
|
|
139
|
-
Furthermore, you can find in this module [stock screeners](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery
|
|
139
|
+
Furthermore, you can find in this module [stock screeners](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery/stock-screener), [sector/industry performance](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery/sector-performance) and [news feeds](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery/stock-market-news) and more. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/discovery-notebook) and the full instrument discovery documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery).**
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
### Obtaining Historical Data
|
|
143
143
|
|
|
144
|
-
Obtain [historical data](https://www.jeroenbouma.com/projects/financetoolkit/docs
|
|
144
|
+
Obtain [historical data](https://www.jeroenbouma.com/projects/financetoolkit/docs/historical-data) on a daily, weekly, monthly or yearly basis. This includes OHLC, volumes, dividends, returns and cumulative returns for each corresponding period.
|
|
145
145
|
|
|
146
146
|
```python
|
|
147
147
|
# Obtain historical market data for all tickers
|
|
@@ -165,11 +165,11 @@ And below the cumulative returns are plotted which include the S&P 500 as benchm
|
|
|
165
165
|
|
|
166
166
|

|
|
167
167
|
|
|
168
|
-
Metrics such as `Volatility`, `Excess Return` and `Excess Volatility` are calculated as dedicated [Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk
|
|
168
|
+
Metrics such as `Volatility`, `Excess Return` and `Excess Volatility` are calculated as dedicated [Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/volatility) and [Performance](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/excess-return) methods rather than columns on this table to create more efficient and flexible functionalities. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/getting-started) and the full historical data documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/historical-data).**
|
|
169
169
|
|
|
170
170
|
### Obtaining Financial Statements
|
|
171
171
|
|
|
172
|
-
Obtain an [Income Statement](https://www.jeroenbouma.com/projects/financetoolkit/docs
|
|
172
|
+
Obtain an [Income Statement](https://www.jeroenbouma.com/projects/financetoolkit/docs/income-statements) on an annual or quarterly basis. This can also be a [balance statement](https://www.jeroenbouma.com/projects/financetoolkit/docs/balance-sheet-statements) or [cash flow statement](https://www.jeroenbouma.com/projects/financetoolkit/docs/cash-flow-statements).
|
|
173
173
|
|
|
174
174
|
```python
|
|
175
175
|
# Obtain the Income Statement for all tickers
|
|
@@ -195,7 +195,7 @@ And below the Earnings Before Interest, Taxes, Depreciation and Amortization (EB
|
|
|
195
195
|
|
|
196
196
|
### Obtaining Financial Ratios
|
|
197
197
|
|
|
198
|
-
Get [Profitability Ratios](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios
|
|
198
|
+
Get [Profitability Ratios](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-profitability-ratios) based on the inputted balance sheet, income and cash flow statements. This can be any of the 80+ ratios within the `ratios` module.
|
|
199
199
|
|
|
200
200
|
```python
|
|
201
201
|
# Collect all Profitability Ratios for all tickers
|
|
@@ -219,11 +219,11 @@ And below a few of the profitability ratios are plotted for Microsoft.
|
|
|
219
219
|
|
|
220
220
|

|
|
221
221
|
|
|
222
|
-
The 80+ ratios are divided into five categories: [**Efficiency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios
|
|
222
|
+
The 80+ ratios are divided into five categories: [**Efficiency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-efficiency-ratios) (asset/inventory/receivables turnover, cash conversion cycle, R&D/SG&A/SBC-to-revenue), [**Liquidity**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-liquidity-ratios) (current, quick and cash ratios, working capital), [**Profitability**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-profitability-ratios) (margins, ROE/ROA/ROIC, cash vs. effective tax rate), [**Solvency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-solvency-ratios) (debt-to-equity, debt-to-capital, interest and dividend coverage) and [**Valuation**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/all-valuation-ratios) (P/E, PEG, Forward P/E, EV multiples, buyback and shareholder yield). It's also possible to define fully [custom ratios](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios/custom-ratios) calculated automatically from the balance sheet, income and cash flow statements. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/ratios-notebook) and the full ratio-by-ratio documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios).**
|
|
223
223
|
|
|
224
224
|
### Obtaining Financial Models
|
|
225
225
|
|
|
226
|
-
Get an [Extended DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models
|
|
226
|
+
Get an [Extended DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/extended-dupont-analysis) based on the inputted balance sheet, income and cash flow statements.
|
|
227
227
|
|
|
228
228
|
```python
|
|
229
229
|
# Get the Extended DuPont Analysis for all tickers
|
|
@@ -248,11 +248,11 @@ And below each component of the Extended Dupont Analysis is plotted including th
|
|
|
248
248
|
|
|
249
249
|

|
|
250
250
|
|
|
251
|
-
The `models` module covers 10+ models in total, for example [DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models
|
|
251
|
+
The `models` module covers 10+ models in total, for example [DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/dupont-analysis), [WACC](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/weighted-average-cost-of-capital-wacc), [Economic Value Added (EVA)](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/economic-value-added-eva), [Altman Z-Score](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/altman-z-score), [Beneish M-Score](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/beneish-m-score) and the [Graham Number](https://www.jeroenbouma.com/projects/financetoolkit/docs/models/graham-number). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/models-notebook) and the full model-by-model documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/models).**
|
|
252
252
|
|
|
253
253
|
### Obtaining Options and Greeks
|
|
254
254
|
|
|
255
|
-
Get the [Black Scholes Model](https://www.jeroenbouma.com/projects/financetoolkit/docs/options
|
|
255
|
+
Get the [Black Scholes Model](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/black-scholes-model) for both call and put options including the relevant Greeks, in this case [Delta](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/delta), [Gamma](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/gamma), [Theta](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/theta) and [Vega](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/vega). This can be any of the First, Second or Third Order Greeks.
|
|
256
256
|
|
|
257
257
|
```python
|
|
258
258
|
# Get Delta for all tickers across strikes and expirations
|
|
@@ -276,11 +276,11 @@ Which can also be plotted together with Gamma, Theta and Vega as follows:
|
|
|
276
276
|
|
|
277
277
|

|
|
278
278
|
|
|
279
|
-
The `options` module is divided into four categories: [**Option Pricing**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options
|
|
279
|
+
The `options` module is divided into four categories: [**Option Pricing**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/black-scholes-model) (Black-Scholes, Binomial Model, Implied Volatility), [**First-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/first-order-greeks) (Delta, Vega, Theta, Rho), [**Second-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/second-order-greeks) (Gamma, Vanna, Charm, Vomma) and [**Third-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options/third-order-greeks) (Speed, Zomma, Color, Ultima). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/options-notebook) and the full option pricing and Greeks documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/options).**
|
|
280
280
|
|
|
281
281
|
### Obtaining Performance Metrics
|
|
282
282
|
|
|
283
|
-
Get the correlations with the [factors as defined by Fama-and-French](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance
|
|
283
|
+
Get the correlations with the [factors as defined by Fama-and-French](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/factor-asset-correlations). These include market, size, value, operating profitability and investment. The beauty of all functionality here is that it can be based on any period as the function accepts the period `intraday`, `weekly`, `monthly`, `quarterly` and `yearly`.
|
|
284
284
|
|
|
285
285
|
```python
|
|
286
286
|
# Get the Fama-French factor correlations for all tickers, quarterly
|
|
@@ -304,11 +304,11 @@ And below the correlations with each factor are plotted over time for both Apple
|
|
|
304
304
|
|
|
305
305
|

|
|
306
306
|
|
|
307
|
-
Beyond Beta, CAPM and the Fama-French factors, the `performance` module covers around 20+ metrics in total, for example [Sharpe Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance
|
|
307
|
+
Beyond Beta, CAPM and the Fama-French factors, the `performance` module covers around 20+ metrics in total, for example [Sharpe Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/sharpe-ratio), [Sortino Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/sortino-ratio), [Calmar Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/calmar-ratio), [Omega Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/omega-ratio) and the [Correlation Matrix](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance/correlation-matrix). Most of these also support `rolling=<n>` for a value that evolves through time instead of one number per period. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/performance-notebook) and the full performance metric documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance).**
|
|
308
308
|
|
|
309
309
|
### Obtaining Risk Metrics
|
|
310
310
|
|
|
311
|
-
Get the [Value at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk
|
|
311
|
+
Get the [Value at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/value-at-risk-var) for each week. Here, the days within each week are considered for the Value at Risk. This makes it so that you can understand within each period what is the expected Value at Risk (VaR) which can again be any period but also based on distributions such as Historical, Gaussian, Student-t, Cornish-Fisher, or a Peak-over-Threshold Extreme Value Theory (`distribution="evt"`) fit for the tail.
|
|
312
312
|
|
|
313
313
|
```python
|
|
314
314
|
# Get the weekly Value at Risk for all tickers
|
|
@@ -327,11 +327,11 @@ And below the Value at Risk (VaR) for Apple, Microsoft and the benchmark (S&P 50
|
|
|
327
327
|
|
|
328
328
|

|
|
329
329
|
|
|
330
|
-
Beyond VaR/CVaR/Entropic VaR, the `risk` module covers around 20+ metrics in total, for example [Conditional Drawdown at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk
|
|
330
|
+
Beyond VaR/CVaR/Entropic VaR, the `risk` module covers around 20+ metrics in total, for example [Conditional Drawdown at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/conditional-drawdown-at-risk-cdar), [Maximum Drawdown Duration](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/maximum-drawdown-duration), [EWMA Volatility](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/ewma-volatility) and the [Hurst Exponent](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk/hurst-exponent). Most of these support `rolling=<n>` for a value that evolves through time instead of one number per period. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/risk-notebook) and the full risk metric documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk).**
|
|
331
331
|
|
|
332
332
|
### Obtaining Technical Indicators
|
|
333
333
|
|
|
334
|
-
Get the [Ichimoku Cloud](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals
|
|
334
|
+
Get the [Ichimoku Cloud](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/ichimoku-cloud) parameters based on the historical market data. This can be any of the 40+ technical indicators within the `technicals` module.
|
|
335
335
|
|
|
336
336
|
```python
|
|
337
337
|
# Get the Ichimoku Cloud for all tickers
|
|
@@ -355,11 +355,11 @@ And below the Ichimoku Cloud parameters are plotted for Apple and Microsoft side
|
|
|
355
355
|
|
|
356
356
|

|
|
357
357
|
|
|
358
|
-
The 40+ indicators are divided into four categories: [**Breadth**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals
|
|
358
|
+
The 40+ indicators are divided into four categories: [**Breadth**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-breadth-indicators) (McClellan Oscillator, Advancers/Decliners, OBV, ADL, Chaikin Oscillator, TRIN, New Highs - New Lows), [**Momentum**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-momentum-indicators) (RSI, MACD, Stochastic, Williams %R, Aroon, CCI, ADX and more), [**Overlap**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-overlap-indicators) (SMA, EMA, DEMA, TRIX, WMA, Hull MA, VWAP, Parabolic SAR, Pivot Points, Support/Resistance) and [**Volatility**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals/all-volatility-indicators) (ATR, Keltner Channels, Bollinger Bands, Donchian Channels, Volatility Cone). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/technicals-notebook) and the full technical indicator documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals).**
|
|
359
359
|
|
|
360
360
|
### Obtaining Fixed Income Metrics
|
|
361
361
|
|
|
362
|
-
Get access to the [ICE BofA Corporate Bond](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome
|
|
362
|
+
Get access to the [ICE BofA Corporate Bond](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/effective-yield) benchmark indices and a variety of other bond and derivative related valuations within the `fixedincome` module.
|
|
363
363
|
|
|
364
364
|
```python
|
|
365
365
|
# Get the ICE BofA Effective Yield for each Credit Rating
|
|
@@ -380,11 +380,11 @@ And below a variety of Fixed Income metrics are shown all acquired from the Fixe
|
|
|
380
380
|
|
|
381
381
|

|
|
382
382
|
|
|
383
|
-
Beyond ICE BofA benchmarks, the `fixedincome` module covers [**Bond Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome
|
|
383
|
+
Beyond ICE BofA benchmarks, the `fixedincome` module covers [**Bond Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/general-statistics) (Present Value, Macaulay/Modified Duration, Convexity, Yield to Maturity), [**Derivative Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/black-model) (Black and Bachelier models for Swaptions), [**Government Bonds**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/3-month-government-bond-yield) (3-month and 10-year yields) and **Central Bank rates** ([Euribor](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/euro-interbank-offered-rate-euribor), [ECB](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/main-refinancing-operations-ecb) and [Federal Reserve rates](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome/secured-overnight-financing-rate-sofr) incl. SOFR). It can be called via `companies.fixedincome` or standalone through `from financetoolkit import FixedIncome`. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/fixed-income-notebook) and the full fixed income documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome).**
|
|
384
384
|
|
|
385
385
|
### Understanding Key Economic Indicators
|
|
386
386
|
|
|
387
|
-
Get insights for 60+ countries into key economic indicators such as the [Consumer Price Index (CPI)](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics
|
|
387
|
+
Get insights for 60+ countries into key economic indicators such as the [Consumer Price Index (CPI)](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/consumer-price-index), [Gross Domestic Product (GDP)](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/gross-domestic-product-gdp), [Unemployment Rates](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/unemployment-rates) and [3-month](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/short-term-interest-rate) and [10-year](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/long-term-interest-rate) Government Interest Rates. This is done through the `economics` module and can be used as a standalone module as well by using `from financetoolkit import Economics`.
|
|
388
388
|
|
|
389
389
|
```python
|
|
390
390
|
# Get the Unemployment Rate for a selection of countries
|
|
@@ -406,7 +406,7 @@ And below these Unemployment Rates are plotted over time:
|
|
|
406
406
|
|
|
407
407
|

|
|
408
408
|
|
|
409
|
-
The 40+ indicators are divided into five categories: [**Government**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics
|
|
409
|
+
The 40+ indicators are divided into five categories: [**Government**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/government-debt) (GDP, government debt/revenue/expenditure/deficit, trust in government), [**Economy**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/consumer-price-index) (CPI, inflation, consumer/business confidence, house/rent/share prices), [**Finance**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/money-supply) (money supply, central bank policy rate, short/long-term interest rates), [**Environment**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/renewable-energy) (renewable energy, carbon footprint) and [**Jobs & Society**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics/unemployment-rates) (unemployment, labour productivity, income inequality, population, poverty rate). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/economics-notebook) and the full economic indicator documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics).**
|
|
410
410
|
|
|
411
411
|
### Explore your own Portfolio
|
|
412
412
|
|
|
@@ -445,7 +445,7 @@ In which the weights and returns can be depicted as follows:
|
|
|
445
445
|
|
|
446
446
|
### Applying Econometric Techniques
|
|
447
447
|
|
|
448
|
-
The `econometrics` module provides [regression](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics
|
|
448
|
+
The `econometrics` module provides [regression](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/ordinary-least-squares-ols), [hypothesis testing](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/jarque-bera-test), [unit root and cointegration](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/augmented-dickey-fuller-adf), [Granger causality](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/granger-causality) and [panel data](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/fixed-effects) methods built on `statsmodels` and `linearmodels`. It requires the optional `financetoolkit[econometrics]` extra (`pip install financetoolkit[econometrics]`) and can be used via `companies.econometrics`.
|
|
449
449
|
|
|
450
450
|
```python
|
|
451
451
|
# AAPL is the Toolkit's first ticker, so it's the default dependent ticker;
|
|
@@ -469,7 +469,7 @@ Regressing Apple's returns on a mix of its chip suppliers, megacap peers and two
|
|
|
469
469
|
| XOM | -0.0291 | 0.0373 | -0.7799 | 0.4364 |
|
|
470
470
|
| PG | 0.2858 | 0.0707 | 4.0393 | 0.0001 |
|
|
471
471
|
|
|
472
|
-
Only `QCOM`, `SWKS`, `MSFT` and `GOOGL` come out statistically significant once every regressor is controlled for at once. The `econometrics` module covers 48 methods in total, including [unit root tests](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics
|
|
472
|
+
Only `QCOM`, `SWKS`, `MSFT` and `GOOGL` come out statistically significant once every regressor is controlled for at once. The `econometrics` module covers 48 methods in total, including [unit root tests](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/augmented-dickey-fuller-adf) (ADF, KPSS, Phillips-Perron), [cointegration and Granger causality](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/engle-granger-cointegration), [panel data estimators](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/fixed-effects) (Fixed/Random Effects), [causal inference](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/propensity-score-matching-psm) (IV-2SLS, Difference-in-Differences, Regression Discontinuity, Propensity Score Matching, Synthetic Control) and [time-series forecasting](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics/arima-forecast) (ARIMA, VAR, VECM). **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/econometrics-notebook) and the full econometrics documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics).**
|
|
473
473
|
|
|
474
474
|
# MCP Server
|
|
475
475
|
|
|
@@ -572,7 +572,7 @@ This is related to the `benchmark_ticker` parameter which is set to "SPY" (S&P 5
|
|
|
572
572
|
|
|
573
573
|
> **Data collection seems to be slow, what could be the issue?**
|
|
574
574
|
|
|
575
|
-
Generally, it should take less than 15 seconds to retrieve the historical data of 100 tickers. If it takes much longer, this could be due to reaching the API limit (the Starter plan has 250 requests per minute), due to a slow internet connection or due to unoptimized code.
|
|
575
|
+
Generally, it should take less than 15 seconds to retrieve the historical data of 100 tickers. If it takes much longer, this could be due to reaching the API limit (the Starter plan has 250 requests per minute), due to a slow internet connection or due to unoptimized code. The Finance Toolkit collects data with a bounded pool of worker threads (10 by default, configurable through the `FINANCETOOLKIT_MAX_WORKERS` environment variable) over a shared connection, so it is recommended to initialize the Toolkit with all tickers you want to analyze at once rather than one at a time. If it is taking 10+ minutes consider having a look at [this issue](https://github.com/JerBouma/FinanceToolkit/issues/99#issuecomment-1889726000) that managed to resolve the problem.
|
|
576
576
|
|
|
577
577
|
> **Are you part of FinancialModelingPrep?**
|
|
578
578
|
|
|
@@ -169,6 +169,31 @@ class CachePlan:
|
|
|
169
169
|
"""
|
|
170
170
|
return [entity for entity, gaps in self.missing.items() if gaps]
|
|
171
171
|
|
|
172
|
+
def cached_frame(self, entity: str) -> pd.DataFrame | None:
|
|
173
|
+
"""
|
|
174
|
+
The cached data for `entity` narrowed to a DataFrame, for the datasets that
|
|
175
|
+
only ever store frames; None when nothing is cached for it.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
entity (str): The entity (ticker, series id, country) to look up.
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
pd.DataFrame | None: The cached frame, or None when absent.
|
|
182
|
+
|
|
183
|
+
Raises:
|
|
184
|
+
TypeError: If the cached entry is a Series, which means the dataset is
|
|
185
|
+
written by one code path and read by another that disagree on shape.
|
|
186
|
+
"""
|
|
187
|
+
cached = self.cached.get(entity)
|
|
188
|
+
|
|
189
|
+
if cached is not None and not isinstance(cached, pd.DataFrame):
|
|
190
|
+
raise TypeError(
|
|
191
|
+
f"The cached entry for {entity!r} is a {type(cached).__name__}, but a "
|
|
192
|
+
"DataFrame was expected."
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
return cached
|
|
196
|
+
|
|
172
197
|
@property
|
|
173
198
|
def fully_cached(self) -> bool:
|
|
174
199
|
"""
|
|
@@ -736,7 +761,8 @@ class Cache:
|
|
|
736
761
|
if not self._enabled or self._backend is None:
|
|
737
762
|
return {"enabled": False, "location": str(self._location)}
|
|
738
763
|
|
|
739
|
-
|
|
764
|
+
# The backend only reports row counts; the flags added here widen the value type.
|
|
765
|
+
statistics: dict[str, Any] = dict(self._backend.get_statistics())
|
|
740
766
|
statistics["enabled"] = True
|
|
741
767
|
statistics["location"] = str(self._location)
|
|
742
768
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
__docformat__ = "google"
|
|
4
4
|
|
|
5
5
|
import contextlib
|
|
6
|
+
from datetime import date
|
|
6
7
|
|
|
7
8
|
import pandas as pd
|
|
8
9
|
|
|
@@ -73,8 +74,8 @@ def get_date_bounds(
|
|
|
73
74
|
|
|
74
75
|
def slice_frame(
|
|
75
76
|
data: pd.DataFrame | pd.Series,
|
|
76
|
-
start: str | None = None,
|
|
77
|
-
end: str | None = None,
|
|
77
|
+
start: str | date | None = None,
|
|
78
|
+
end: str | date | None = None,
|
|
78
79
|
date_axis: int = 0,
|
|
79
80
|
) -> pd.DataFrame | pd.Series:
|
|
80
81
|
"""
|
|
@@ -87,8 +88,8 @@ def slice_frame(
|
|
|
87
88
|
|
|
88
89
|
Args:
|
|
89
90
|
data (pd.DataFrame | pd.Series): The frame to slice.
|
|
90
|
-
start (str | None): Inclusive start of the window. None leaves it open.
|
|
91
|
-
end (str | None): Inclusive end of the window. None leaves it open.
|
|
91
|
+
start (str | date | None): Inclusive start of the window. None leaves it open.
|
|
92
|
+
end (str | date | None): Inclusive end of the window. None leaves it open.
|
|
92
93
|
date_axis (int): 0 when the index holds the dates, 1 when the columns do.
|
|
93
94
|
|
|
94
95
|
Returns:
|
{financetoolkit-2.2.0 → financetoolkit-2.2.1}/financetoolkit/discovery/discovery_controller.py
RENAMED
|
@@ -9,7 +9,7 @@ import pandas as pd
|
|
|
9
9
|
from financetoolkit import fmp_model
|
|
10
10
|
from financetoolkit.cache import cache_controller
|
|
11
11
|
from financetoolkit.discovery import discovery_model
|
|
12
|
-
from financetoolkit.utilities import logger_model
|
|
12
|
+
from financetoolkit.utilities import logger_model, validation_model
|
|
13
13
|
from financetoolkit.utilities.error_model import handle_errors
|
|
14
14
|
|
|
15
15
|
# pylint: disable=too-many-instance-attributes,too-few-public-methods,too-many-lines,
|
|
@@ -21,7 +21,7 @@ logger_model.setup_logger()
|
|
|
21
21
|
logger = logger_model.get_logger()
|
|
22
22
|
|
|
23
23
|
# Used as the Toolkit's default API key when set as an environment variable.
|
|
24
|
-
API_KEY: str = os.environ.get("FINANCIAL_MODELING_PREP_API_KEY"
|
|
24
|
+
API_KEY: str | None = os.environ.get("FINANCIAL_MODELING_PREP_API_KEY")
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class Discovery:
|
|
@@ -76,6 +76,9 @@ class Discovery:
|
|
|
76
76
|
| RBMNF | Rugby Resources Ltd. | 0.065 | Other OTC | PNK |
|
|
77
77
|
| RBMS.JK | PT Ristia Bintang Mahkotasejati Tbk | 50 | Jakarta Stock Exchange | JKT |
|
|
78
78
|
"""
|
|
79
|
+
# A copied documentation example passes the placeholder key, treated as no key at all.
|
|
80
|
+
api_key = validation_model.resolve_api_key(api_key)
|
|
81
|
+
|
|
79
82
|
if not api_key:
|
|
80
83
|
raise ValueError(
|
|
81
84
|
"Please enter an API key from FinancialModelingPrep. "
|