financetoolkit 2.2.0__tar.gz → 2.2.2__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.
Files changed (199) hide show
  1. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/PKG-INFO +179 -61
  2. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/README.md +173 -58
  3. financetoolkit-2.2.2/financetoolkit/__init__.py +54 -0
  4. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/cache_controller.py +131 -17
  5. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/frame_model.py +60 -4
  6. financetoolkit-2.2.2/financetoolkit/cache/policy_model.py +281 -0
  7. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/ticker_model.py +36 -1
  8. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/currencies_model.py +188 -0
  9. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/discovery/discovery_controller.py +561 -252
  10. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/discovery/discovery_model.py +196 -2
  11. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/causal_inference_model.py +32 -32
  12. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/diagnostics_model.py +12 -7
  13. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/econometrics_controller.py +1286 -596
  14. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/forecast_evaluation_model.py +4 -4
  15. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/panel_data_model.py +22 -16
  16. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/regression_model.py +13 -8
  17. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/unitroot_model.py +8 -3
  18. financetoolkit-2.2.2/financetoolkit/economics/bis_model.py +269 -0
  19. financetoolkit-2.2.2/financetoolkit/economics/bls_model.py +106 -0
  20. financetoolkit-2.2.2/financetoolkit/economics/boe_model.py +508 -0
  21. financetoolkit-2.2.2/financetoolkit/economics/boj_model.py +111 -0
  22. financetoolkit-2.2.2/financetoolkit/economics/cboe_model.py +140 -0
  23. financetoolkit-2.2.2/financetoolkit/economics/dnb_model.py +272 -0
  24. financetoolkit-2.2.2/financetoolkit/economics/ecb_model.py +405 -0
  25. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/economics/economics_controller.py +3859 -1005
  26. financetoolkit-2.2.2/financetoolkit/economics/eex_model.py +99 -0
  27. financetoolkit-2.2.2/financetoolkit/economics/esrb_model.py +191 -0
  28. financetoolkit-2.2.2/financetoolkit/economics/eurostat_model.py +484 -0
  29. financetoolkit-2.2.2/financetoolkit/economics/fmp_model.py +324 -0
  30. financetoolkit-2.2.2/financetoolkit/economics/frb_model.py +276 -0
  31. financetoolkit-2.2.2/financetoolkit/economics/freddie_mac_model.py +50 -0
  32. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/economics/gmdb_model.py +175 -24
  33. financetoolkit-2.2.2/financetoolkit/economics/helpers.py +524 -0
  34. financetoolkit-2.2.2/financetoolkit/economics/ibge_model.py +70 -0
  35. financetoolkit-2.2.2/financetoolkit/economics/imf_model.py +200 -0
  36. financetoolkit-2.2.2/financetoolkit/economics/macrohistory_model.py +97 -0
  37. financetoolkit-2.2.2/financetoolkit/economics/mof_model.py +80 -0
  38. financetoolkit-2.2.2/financetoolkit/economics/nber_model.py +81 -0
  39. financetoolkit-2.2.2/financetoolkit/economics/ngfs_model.py +317 -0
  40. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/economics/oecd_model.py +66 -3
  41. financetoolkit-2.2.2/financetoolkit/economics/ons_model.py +139 -0
  42. financetoolkit-2.2.2/financetoolkit/economics/sbj_model.py +168 -0
  43. financetoolkit-2.2.2/financetoolkit/economics/shiller_model.py +122 -0
  44. financetoolkit-2.2.2/financetoolkit/economics/stoxx_model.py +92 -0
  45. financetoolkit-2.2.2/financetoolkit/economics/treasury_model.py +240 -0
  46. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/economics/yfinance_model.py +4 -4
  47. financetoolkit-2.2.2/financetoolkit/fixedincome/boc_model.py +91 -0
  48. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/bond_model.py +73 -37
  49. financetoolkit-2.2.2/financetoolkit/fixedincome/bundesbank_model.py +556 -0
  50. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/derivative_model.py +38 -7
  51. financetoolkit-2.2.2/financetoolkit/fixedincome/eiopa_model.py +434 -0
  52. financetoolkit-2.2.2/financetoolkit/fixedincome/esma_model.py +239 -0
  53. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/fixedincome_controller.py +1978 -330
  54. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/fmp_model.py +12 -11
  55. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/fred_model.py +202 -16
  56. financetoolkit-2.2.2/financetoolkit/fixedincome/norgesbank_model.py +64 -0
  57. financetoolkit-2.2.2/financetoolkit/fixedincome/rba_model.py +134 -0
  58. financetoolkit-2.2.2/financetoolkit/fixedincome/riksbank_model.py +164 -0
  59. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fmp_model.py +1277 -263
  60. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fundamentals_model.py +108 -50
  61. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/helpers.py +141 -12
  62. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/historical_model.py +320 -172
  63. financetoolkit-2.2.2/financetoolkit/mcp_server/analytics_model.py +444 -0
  64. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/auth_model.py +5 -5
  65. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/config.yaml +154 -17
  66. financetoolkit-2.2.2/financetoolkit/mcp_server/diagnostics_model.py +150 -0
  67. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/formatting_model.py +24 -2
  68. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/inspection_controller.py +4 -2
  69. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcp_controller.py +94 -26
  70. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcpb/manifest.json +10 -10
  71. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcpb/pyproject.toml +2 -2
  72. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/provider_model.py +98 -47
  73. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/registry_controller.py +210 -42
  74. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/tools_model.py +12 -2
  75. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/enterprise_model.py +14 -13
  76. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/fulmer_model.py +6 -1
  77. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/growth_model.py +3 -2
  78. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/helpers.py +4 -2
  79. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/intrinsic_model.py +15 -4
  80. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/models_controller.py +398 -260
  81. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/ohlson_model.py +6 -1
  82. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/piotroski_model.py +83 -94
  83. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/wacc_model.py +18 -9
  84. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization_model.py +27 -7
  85. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/binomial_trees_model.py +28 -8
  86. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/black_scholes_model.py +43 -23
  87. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/exotics_model.py +28 -4
  88. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/greeks_model.py +19 -0
  89. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/helpers.py +60 -10
  90. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/options_controller.py +1189 -830
  91. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/options_model.py +200 -14
  92. financetoolkit-2.2.2/financetoolkit/performance/helpers.py +143 -0
  93. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/performance/performance_controller.py +729 -551
  94. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/performance/performance_model.py +192 -75
  95. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/helpers.py +3 -1
  96. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/overview_model.py +5 -2
  97. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/portfolio_controller.py +165 -146
  98. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/portfolio_model.py +11 -11
  99. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/ratios/efficiency_model.py +56 -56
  100. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/ratios/liquidity_model.py +29 -25
  101. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/ratios/profitability_model.py +72 -58
  102. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/ratios/ratios_controller.py +1031 -511
  103. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/ratios/solvency_model.py +47 -44
  104. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/ratios/valuation_model.py +87 -76
  105. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/backtesting_model.py +5 -0
  106. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/cvar_model.py +19 -17
  107. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/garch_model.py +81 -49
  108. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/helpers.py +13 -4
  109. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/market_liquidity_model.py +1 -0
  110. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/realized_volatility_model.py +2 -1
  111. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/risk_controller.py +1039 -657
  112. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/risk_model.py +102 -52
  113. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/var_model.py +10 -31
  114. financetoolkit-2.2.2/financetoolkit/technicals/__init__.py +0 -0
  115. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/technicals/breadth_model.py +12 -5
  116. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/technicals/momentum_model.py +34 -14
  117. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/technicals/overlap_model.py +75 -35
  118. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/technicals/technicals_controller.py +812 -588
  119. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/technicals/volatility_model.py +59 -48
  120. financetoolkit-2.2.2/financetoolkit/toolkit_controller.py +5745 -0
  121. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/utilities/dataframe_model.py +98 -4
  122. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/utilities/error_model.py +153 -56
  123. financetoolkit-2.2.2/financetoolkit/utilities/excel_model.py +104 -0
  124. financetoolkit-2.2.2/financetoolkit/utilities/requests_model.py +207 -0
  125. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/utilities/statistics_model.py +151 -62
  126. financetoolkit-2.2.2/financetoolkit/utilities/validation_model.py +176 -0
  127. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/yfinance_model.py +46 -31
  128. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/pyproject.toml +23 -12
  129. financetoolkit-2.2.0/financetoolkit/__init__.py +0 -8
  130. financetoolkit-2.2.0/financetoolkit/cache/policy_model.py +0 -135
  131. financetoolkit-2.2.0/financetoolkit/performance/helpers.py +0 -216
  132. financetoolkit-2.2.0/financetoolkit/technicals/helpers.py +0 -72
  133. financetoolkit-2.2.0/financetoolkit/toolkit_controller.py +0 -4508
  134. financetoolkit-2.2.0/financetoolkit/utilities/requests_model.py +0 -107
  135. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/.gitignore +0 -0
  136. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/LICENSE.txt +0 -0
  137. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/__init__.py +0 -0
  138. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/coverage_model.py +0 -0
  139. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/request_model.py +0 -0
  140. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/serialization_model.py +0 -0
  141. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/cache/sqlite_model.py +0 -0
  142. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/discovery/__init__.py +0 -0
  143. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/__init__.py +0 -0
  144. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/causality_model.py +0 -0
  145. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/cointegration_model.py +0 -0
  146. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/event_study_model.py +0 -0
  147. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/fama_macbeth_model.py +0 -0
  148. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/hypothesis_testing_model.py +0 -0
  149. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/specification_tests_model.py +0 -0
  150. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/econometrics/time_series_model.py +0 -0
  151. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/economics/__init__.py +0 -0
  152. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/economics/fred_model.py +0 -0
  153. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/__init__.py +0 -0
  154. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/ecb_model.py +0 -0
  155. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/euribor_model.py +0 -0
  156. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/fed_model.py +0 -0
  157. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/helpers.py +0 -0
  158. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/fixedincome/yieldcurve_model.py +0 -0
  159. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/__init__.py +0 -0
  160. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/__main__.py +0 -0
  161. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/coercion_model.py +0 -0
  162. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcpb/.mcpbignore +0 -0
  163. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcpb/LICENSE +0 -0
  164. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcpb/README.md +0 -0
  165. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcpb/build-mcpb.sh +0 -0
  166. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/mcpb/finance_toolkit_icon.png +0 -0
  167. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/mcp_server/setup_model.py +0 -0
  168. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/__init__.py +0 -0
  169. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/altman_model.py +0 -0
  170. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/beneish_model.py +0 -0
  171. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/dupont_model.py +0 -0
  172. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/eva_model.py +0 -0
  173. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/grover_model.py +0 -0
  174. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/springate_model.py +0 -0
  175. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/models/zmijewski_model.py +0 -0
  176. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/balance.csv +0 -0
  177. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/balance_yf.csv +0 -0
  178. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/cash.csv +0 -0
  179. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/cash_yf.csv +0 -0
  180. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/income.csv +0 -0
  181. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/income_yf.csv +0 -0
  182. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/statistics.csv +0 -0
  183. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/normalization/statistics_yf.csv +0 -0
  184. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/__init__.py +0 -0
  185. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/risk_neutral_density_model.py +0 -0
  186. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/options/svi_model.py +0 -0
  187. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/performance/__init__.py +0 -0
  188. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/__init__.py +0 -0
  189. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/config.yaml +0 -0
  190. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/example_datasets/example_portfolio.csv +0 -0
  191. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/portfolio/example_datasets/example_portfolio.xlsx +0 -0
  192. /financetoolkit-2.2.0/financetoolkit/ratios/__init__.py → /financetoolkit-2.2.2/financetoolkit/py.typed +0 -0
  193. {financetoolkit-2.2.0/financetoolkit/risk → financetoolkit-2.2.2/financetoolkit/ratios}/__init__.py +0 -0
  194. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/ratios/helpers.py +0 -0
  195. {financetoolkit-2.2.0/financetoolkit/technicals → financetoolkit-2.2.2/financetoolkit/risk}/__init__.py +0 -0
  196. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/copula_model.py +0 -0
  197. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/covar_model.py +0 -0
  198. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/financetoolkit/risk/evar_model.py +0 -0
  199. {financetoolkit-2.2.0 → financetoolkit-2.2.2}/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.0
3
+ Version: 2.2.2
4
4
  Summary: Transparent and Efficient Financial Analysis
5
5
  Author: Jeroen Bouma
6
6
  License: MIT
@@ -17,11 +17,14 @@ Classifier: Programming Language :: Python :: 3.14
17
17
  Classifier: Programming Language :: Python :: 3.15
18
18
  Classifier: Topic :: Office/Business :: Financial :: Investment
19
19
  Requires-Python: <3.16,>=3.11
20
+ Requires-Dist: numpy>=1.26
20
21
  Requires-Dist: openpyxl>=3.1
21
22
  Requires-Dist: pandas>=3.0
23
+ Requires-Dist: python-calamine>=0.3.0; python_full_version < '3.15'
22
24
  Requires-Dist: pyyaml>=6.0
23
25
  Requires-Dist: requests>=2.32
24
- Requires-Dist: scikit-learn>=1.6
26
+ Requires-Dist: scipy>=1.10
27
+ Requires-Dist: xlrd>=2.0
25
28
  Requires-Dist: yfinance
26
29
  Provides-Extra: econometrics
27
30
  Requires-Dist: linearmodels>=6.0; extra == 'econometrics'
@@ -29,7 +32,7 @@ Requires-Dist: statsmodels>=0.14; extra == 'econometrics'
29
32
  Provides-Extra: mcp
30
33
  Requires-Dist: fastmcp>=3.4.2; extra == 'mcp'
31
34
  Requires-Dist: linearmodels>=6.0; extra == 'mcp'
32
- Requires-Dist: mcp[cli]>=1.27.0; extra == 'mcp'
35
+ Requires-Dist: mcp[cli]<2,>=1.27.0; extra == 'mcp'
33
36
  Requires-Dist: python-dotenv>=1.0; extra == 'mcp'
34
37
  Requires-Dist: rich>=13.0; extra == 'mcp'
35
38
  Requires-Dist: statsmodels>=0.14; extra == 'mcp'
@@ -133,7 +136,7 @@ A basic example of how to use the Finance Toolkit is shown below. Every code sni
133
136
  from financetoolkit import Toolkit
134
137
 
135
138
  # Initialize the Toolkit for Apple and Microsoft
136
- companies = Toolkit(["AAPL", "MSFT"], api_key=API_KEY, start_date="2017-12-31")
139
+ companies = Toolkit(["AAPL", "MSFT"], api_key="FINANCIAL_MODELING_PREP_KEY", start_date="2017-12-31")
137
140
  ````
138
141
 
139
142
  Each ratio, indicator and metric has a corresponding function that can be called directly, for example `ratios.get_return_on_equity` or `technicals.get_relative_strength_index`. Every module also has one or more `collect_` functions that return a whole category at once, e.g. `ratios.collect_profitability_ratios`, useful when you want everything in one call instead of assembling it metric by metric.
@@ -155,31 +158,39 @@ from financetoolkit import Discovery
155
158
  # Initialize the standalone Discovery module
156
159
  discovery = Discovery(api_key="FINANCIAL_MODELING_PREP_KEY")
157
160
 
158
- # Screen for stocks matching a set of criteria
159
- discovery.get_stock_screener(
160
- market_cap_higher=1000000,
161
- price_higher=100,
162
- price_lower=200,
163
- beta_higher=1,
164
- beta_lower=1.5,
165
- dividend_higher=1,
161
+ # Find US semiconductor companies worth more than $100 billion
162
+ semiconductors = discovery.get_stock_screener(
163
+ industry="Semiconductors",
164
+ country="US",
165
+ exchange="NASDAQ",
166
+ market_cap_higher=100_000_000_000,
167
+ is_etf=False,
166
168
  )
167
169
  ```
168
170
 
169
- Which returns:
171
+ The screener returns twelve companies, of which the five largest are shown below:
170
172
 
171
- | Symbol | Name | Market Cap | Sector | Industry | Beta | Price | Dividend | Exchange | Country |
172
- |:---------|:------------------|-------------:|:------------------|:-----------------------|-------:|--------:|-----------:|:-------------------------|:----------|
173
- | NKE | NIKE, Inc. | 163403295604 | Consumer Cyclical | Footwear & Accessories | 1.079 | 107.36 | 1.48 | New York Stock Exchange | US |
174
- | SAF.PA | Safran SA | 66234006559 | Industrials | Aerospace & Defense | 1.339 | 160.16 | 1.35 | Paris | FR |
175
- | ROST | Ross Stores, Inc. | 46724188589 | Consumer Cyclical | Apparel Retail | 1.026 | 138.785 | 1.34 | NASDAQ Global Select | US |
173
+ | Symbol | Name | Market Cap | Beta | Price | Dividend |
174
+ |:---------|:-----------------------------|--------------:|-------:|---------:|-----------:|
175
+ | NVDA | NVIDIA Corporation | 5677886820000 | 2.217 | 234.42 | 0.28 |
176
+ | AVGO | Broadcom Inc. | 1688566002696 | 1.457 | 354.92 | 2.60 |
177
+ | MU | Micron Technology, Inc. | 1212744628950 | 2.222 | 1073.81 | 0.53 |
178
+ | AMD | Advanced Micro Devices, Inc. | 1028957518000 | 2.476 | 631.03 | 0.00 |
179
+ | INTC | Intel Corp. | 604977329655 | 2.231 | 119.94 | 0.00 |
176
180
 
177
- Furthermore, you can find in this module [stock screeners](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery#get_stock_screener), [sector/industry performance](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery#get_sectors_performance) and [news feeds](https://www.jeroenbouma.com/projects/financetoolkit/docs/discovery#get_stock_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).**
181
+ And below all twelve are ranked by market cap.
182
+
183
+ <picture>
184
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/discovery-dark.png">
185
+ <img alt="Discovery" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/discovery-light.png">
186
+ </picture>
187
+
188
+ 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
189
 
179
190
 
180
191
  ### Obtaining Historical Data
181
192
 
182
- Obtain [historical data](https://www.jeroenbouma.com/projects/financetoolkit/docs#get_historical_data) on a daily, weekly, monthly or yearly basis. This includes OHLC, volumes, dividends, returns and cumulative returns for each corresponding period.
193
+ 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
194
 
184
195
  ```python
185
196
  # Obtain historical market data for all tickers
@@ -201,13 +212,16 @@ For example, a portion of the historical data for Apple is shown below.
201
212
 
202
213
  And below the cumulative returns are plotted which include the S&P 500 as benchmark:
203
214
 
204
- ![HistoricalData](https://github.com/JerBouma/FinanceToolkit/assets/46355364/cd7b5029-0e66-4592-9822-42b652e7deed)
215
+ <picture>
216
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/historical-dark.png">
217
+ <img alt="HistoricalData" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/historical-light.png">
218
+ </picture>
205
219
 
206
- Metrics such as `Volatility`, `Excess Return` and `Excess Volatility` are calculated as dedicated [Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk#get_volatility) and [Performance](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance#get_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#get_historical_data).**
220
+ 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
221
 
208
222
  ### Obtaining Financial Statements
209
223
 
210
- Obtain an [Income Statement](https://www.jeroenbouma.com/projects/financetoolkit/docs#get_income_statement) on an annual or quarterly basis. This can also be a [balance statement](https://www.jeroenbouma.com/projects/financetoolkit/docs#get_balance_sheet_statement) or [cash flow statement](https://www.jeroenbouma.com/projects/financetoolkit/docs#get_cash_flow_statement).
224
+ 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
225
 
212
226
  ```python
213
227
  # Obtain the Income Statement for all tickers
@@ -227,13 +241,16 @@ For example, the first 5 rows of the Income Statement for Apple are shown below.
227
241
  | Gross Profit Ratio | 0.3847 | 0.3834 | 0.3782 | 0.3823 | 0.4178 | 0.4331 | 0.4413 |
228
242
  | Research and Development Expenses | 1.1581e+10 | 1.4236e+10 | 1.6217e+10 | 1.8752e+10 | 2.1914e+10 | 2.6251e+10 | 2.9915e+10 |
229
243
 
230
- And below the Earnings Before Interest, Taxes, Depreciation and Amortization (EBITDA) are plotted for both Apple and Microsoft. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/getting-started) and the full financial statement documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs).**
244
+ And below the Earnings Before Interest, Taxes, Depreciation and Amortization (EBITDA) are plotted for Apple and Alphabet since 2017. Their fiscal years line up closely, so both show the same latest reported year. **Find the Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/getting-started) and the full financial statement documentation [here](https://www.jeroenbouma.com/projects/financetoolkit/docs).**
231
245
 
232
- ![FinancialStatements](https://github.com/JerBouma/FinanceToolkit/assets/46355364/a4ba0629-0832-4dc0-a5c1-9cf2c9bd13ce)
246
+ <picture>
247
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/statements-dark.png">
248
+ <img alt="FinancialStatements" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/statements-light.png">
249
+ </picture>
233
250
 
234
251
  ### Obtaining Financial Ratios
235
252
 
236
- Get [Profitability Ratios](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios#collect_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.
253
+ 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
254
 
238
255
  ```python
239
256
  # Collect all Profitability Ratios for all tickers
@@ -253,15 +270,18 @@ For example, see some of the profitability ratios of Microsoft below.
253
270
  | Interest Coverage Ratio | 13.9982 | 16.5821 | 20.3429 | 25.3782 | 34.7835 | 47.4275 | 52.0244 |
254
271
  | Income Before Tax Profit Margin | 0.2574 | 0.3305 | 0.3472 | 0.3708 | 0.423 | 0.4222 | 0.4214 |
255
272
 
256
- And below a few of the profitability ratios are plotted for Microsoft.
273
+ And below a few of the profitability ratios of Microsoft, each with its latest value, the change over the period and its trend.
257
274
 
258
- ![FinancialRatios](https://github.com/JerBouma/FinanceToolkit/assets/46355364/93221f7a-face-4035-87c7-e43815e89eb4)
275
+ <picture>
276
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/ratios-dark.png">
277
+ <img alt="FinancialRatios" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/ratios-light.png">
278
+ </picture>
259
279
 
260
- The 80+ ratios are divided into five categories: [**Efficiency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios#collect_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#collect_liquidity_ratios) (current, quick and cash ratios, working capital), [**Profitability**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios#collect_profitability_ratios) (margins, ROE/ROA/ROIC, cash vs. effective tax rate), [**Solvency**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios#collect_solvency_ratios) (debt-to-equity, debt-to-capital, interest and dividend coverage) and [**Valuation**](https://www.jeroenbouma.com/projects/financetoolkit/docs/ratios#collect_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#collect_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).**
280
+ 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
281
 
262
282
  ### Obtaining Financial Models
263
283
 
264
- Get an [Extended DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models#get_extended_dupont_analysis) based on the inputted balance sheet, income and cash flow statements.
284
+ 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
285
 
266
286
  ```python
267
287
  # Get the Extended DuPont Analysis for all tickers
@@ -282,15 +302,18 @@ For example, this shows the Extended DuPont Analysis for Apple:
282
302
  | Equity Multiplier | nan | 3.0724 | 3.5633 | 4.2509 | 5.255 | 6.1862 | 6.252 |
283
303
  | Return on Equity | nan | 0.4936 | 0.5592 | 0.7369 | 1.4744 | 1.7546 | 1.7195 |
284
304
 
285
- And below each component of the Extended Dupont Analysis is plotted including the resulting Return on Equity (ROE).
305
+ The five components of the Extended DuPont Analysis multiply into the Return on Equity (ROE): interest burden × tax burden × operating margin × asset turnover × equity multiplier. Below they are shown for each year, ending in the resulting ROE.
286
306
 
287
- ![Models](https://github.com/JerBouma/FinanceToolkit/assets/46355364/f5e1cab3-d1bd-455d-a4ba-92e1348163be)
307
+ <picture>
308
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/models-dark.png">
309
+ <img alt="Models" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/models-light.png">
310
+ </picture>
288
311
 
289
- The `models` module covers 10+ models in total, for example [DuPont Analysis](https://www.jeroenbouma.com/projects/financetoolkit/docs/models#get_dupont_analysis), [WACC](https://www.jeroenbouma.com/projects/financetoolkit/docs/models#get_weighted_average_cost_of_capital), [Economic Value Added (EVA)](https://www.jeroenbouma.com/projects/financetoolkit/docs/models#get_economic_value_added), [Altman Z-Score](https://www.jeroenbouma.com/projects/financetoolkit/docs/models#get_altman_z_score), [Beneish M-Score](https://www.jeroenbouma.com/projects/financetoolkit/docs/models#get_beneish_m_score) and the [Graham Number](https://www.jeroenbouma.com/projects/financetoolkit/docs/models#get_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).**
312
+ 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
313
 
291
314
  ### Obtaining Options and Greeks
292
315
 
293
- Get the [Black Scholes Model](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#get_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#get_delta), [Gamma](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#get_gamma), [Theta](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#get_theta) and [Vega](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#get_vega). This can be any of the First, Second or Third Order Greeks.
316
+ 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
317
 
295
318
  ```python
296
319
  # Get Delta for all tickers across strikes and expirations
@@ -312,13 +335,16 @@ For example, see the delta of the Call options for Apple for multiple expiration
312
335
 
313
336
  Which can also be plotted together with Gamma, Theta and Vega as follows:
314
337
 
315
- ![Greeks](https://github.com/JerBouma/FinanceToolkit/assets/46355364/3aebe116-c4ac-4845-9801-54d2b4bde0f5)
338
+ <picture>
339
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/greeks-dark.png">
340
+ <img alt="Greeks" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/greeks-light.png">
341
+ </picture>
316
342
 
317
- The `options` module is divided into four categories: [**Option Pricing**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#get_black_scholes_model) (Black-Scholes, Binomial Model, Implied Volatility), [**First-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#collect_first_order_greeks) (Delta, Vega, Theta, Rho), [**Second-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#collect_second_order_greeks) (Gamma, Vanna, Charm, Vomma) and [**Third-Order Greeks**](https://www.jeroenbouma.com/projects/financetoolkit/docs/options#collect_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).**
343
+ 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
344
 
319
345
  ### Obtaining Performance Metrics
320
346
 
321
- Get the correlations with the [factors as defined by Fama-and-French](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance#get_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`.
347
+ 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
348
 
323
349
  ```python
324
350
  # Get the Fama-French factor correlations for all tickers, quarterly
@@ -340,17 +366,20 @@ For example, this shows the quarterly correlations for Apple:
340
366
 
341
367
  And below the correlations with each factor are plotted over time for both Apple and Microsoft.
342
368
 
343
- ![Performance](https://github.com/JerBouma/FinanceToolkit/assets/46355364/9c1eff76-b5c8-4bd2-9f47-8ce70bf002db)
369
+ <picture>
370
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/performance-dark.png">
371
+ <img alt="Performance" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/performance-light.png">
372
+ </picture>
344
373
 
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#get_sharpe_ratio), [Sortino Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance#get_sortino_ratio), [Calmar Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance#get_calmar_ratio), [Omega Ratio](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance#get_omega_ratio) and the [Correlation Matrix](https://www.jeroenbouma.com/projects/financetoolkit/docs/performance#get_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).**
374
+ 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
375
 
347
376
  ### Obtaining Risk Metrics
348
377
 
349
- Get the [Value at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk#get_value_at_risk) 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.
378
+ 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
379
 
351
380
  ```python
352
381
  # Get the weekly Value at Risk for all tickers
353
- companies.risk.get_value_at_risk(period="weekly")
382
+ companies.risk.get_value_at_risk(period="weekly", within_period=True)
354
383
  ```
355
384
 
356
385
  | | AAPL | MSFT | Benchmark |
@@ -363,13 +392,16 @@ companies.risk.get_value_at_risk(period="weekly")
363
392
 
364
393
  And below the Value at Risk (VaR) for Apple, Microsoft and the benchmark (S&P 500) are plotted also demonstrating the impact of COVID-19.
365
394
 
366
- ![Risk](https://github.com/JerBouma/FinanceToolkit/assets/46355364/a95e5b51-f7fc-4a70-bbb4-bf88b346523e)
395
+ <picture>
396
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/risk-dark.png">
397
+ <img alt="Risk" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/risk-light.png">
398
+ </picture>
367
399
 
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#get_conditional_drawdown_at_risk), [Maximum Drawdown Duration](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk#get_maximum_drawdown_duration), [EWMA Volatility](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk#get_ewma_volatility) and the [Hurst Exponent](https://www.jeroenbouma.com/projects/financetoolkit/docs/risk#get_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).**
400
+ 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
401
 
370
402
  ### Obtaining Technical Indicators
371
403
 
372
- Get the [Ichimoku Cloud](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals#get_ichimoku_cloud) parameters based on the historical market data. This can be any of the 40+ technical indicators within the `technicals` module.
404
+ 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
405
 
374
406
  ```python
375
407
  # Get the Ichimoku Cloud for all tickers
@@ -389,15 +421,18 @@ For example, see some of the parameters for Apple below:
389
421
  | 2023-11-02 | 174.005 | 171.725 | 176.235 | 178.8 |
390
422
  | 2023-11-03 | 174.005 | 171.725 | 175.558 | 178.8 |
391
423
 
392
- And below the Ichimoku Cloud parameters are plotted for Apple and Microsoft side-by-side.
424
+ And below the Ichimoku Cloud of the last twelve months is plotted for Apple and Microsoft, together with the closing price.
393
425
 
394
- ![Technicals](https://github.com/JerBouma/FinanceToolkit/assets/46355364/1ced5b34-2410-4206-8ddf-bb053bcb21b2)
426
+ <picture>
427
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/technicals-dark.png">
428
+ <img alt="Technicals" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/technicals-light.png">
429
+ </picture>
395
430
 
396
- The 40+ indicators are divided into four categories: [**Breadth**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals#collect_breadth_indicators) (McClellan Oscillator, Advancers/Decliners, OBV, ADL, Chaikin Oscillator, TRIN, New Highs - New Lows), [**Momentum**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals#collect_momentum_indicators) (RSI, MACD, Stochastic, Williams %R, Aroon, CCI, ADX and more), [**Overlap**](https://www.jeroenbouma.com/projects/financetoolkit/docs/technicals#collect_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#collect_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).**
431
+ 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
432
 
398
433
  ### Obtaining Fixed Income Metrics
399
434
 
400
- Get access to the [ICE BofA Corporate Bond](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome#get_ice_bofa_effective_yield) benchmark indices and a variety of other bond and derivative related valuations within the `fixedincome` module.
435
+ 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
436
 
402
437
  ```python
403
438
  # Get the ICE BofA Effective Yield for each Credit Rating
@@ -414,15 +449,18 @@ For example, see the Effective Yield for the ICE BofA Corporate Bond Index below
414
449
  | 2024-04-24 | 0.0518 | 0.0531 | 0.0559 | 0.0592 | 0.0664 | 0.0778 | 0.1361 |
415
450
  | 2024-04-25 | 0.0524 | 0.0537 | 0.0564 | 0.0598 | 0.0673 | 0.079 | 0.1368 |
416
451
 
417
- And below a variety of Fixed Income metrics are shown all acquired from the Fixed Income module.
452
+ And below the effective yield for each credit rating is plotted over time.
418
453
 
419
- ![Fixed Income](https://github.com/JerBouma/FinanceToolkit/assets/46355364/dfe2a819-87d8-46be-892c-f90663bc177d)
454
+ <picture>
455
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/fixedincome-dark.png">
456
+ <img alt="Fixed Income" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/fixedincome-light.png">
457
+ </picture>
420
458
 
421
- Beyond ICE BofA benchmarks, the `fixedincome` module covers [**Bond Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome#collect_bond_statistics) (Present Value, Macaulay/Modified Duration, Convexity, Yield to Maturity), [**Derivative Valuations**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome#get_derivative_price) (Black and Bachelier models for Swaptions), [**Government Bonds**](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome#get_government_bond_yield) (3-month and 10-year yields) and **Central Bank rates** ([Euribor](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome#get_euribor_rates), [ECB](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome#get_european_central_bank_rates) and [Federal Reserve rates](https://www.jeroenbouma.com/projects/financetoolkit/docs/fixedincome#get_federal_reserve_rates) 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).**
459
+ 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
460
 
423
461
  ### Understanding Key Economic Indicators
424
462
 
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#get_consumer_price_index), [Gross Domestic Product (GDP)](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_gross_domestic_product), [Unemployment Rates](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_unemployment_rate) and [3-month](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_short_term_interest_rate) and [10-year](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_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`.
463
+ 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
464
 
427
465
  ```python
428
466
  # Get the Unemployment Rate for a selection of countries
@@ -442,9 +480,12 @@ For example see a selection of the countries below:
442
480
 
443
481
  And below these Unemployment Rates are plotted over time:
444
482
 
445
- ![Economics](https://github.com/JerBouma/FinanceToolkit/assets/46355364/0bba2ce2-9846-42de-a89d-737cdcd07b31)
483
+ <picture>
484
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/economics-dark.png">
485
+ <img alt="Economics" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/economics-light.png">
486
+ </picture>
446
487
 
447
- The 40+ indicators are divided into five categories: [**Government**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_government_debt) (GDP, government debt/revenue/expenditure/deficit, trust in government), [**Economy**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_consumer_price_index) (CPI, inflation, consumer/business confidence, house/rent/share prices), [**Finance**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_money_supply) (money supply, central bank policy rate, short/long-term interest rates), [**Environment**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_renewable_energy) (renewable energy, carbon footprint) and [**Jobs & Society**](https://www.jeroenbouma.com/projects/financetoolkit/docs/economics#get_unemployment_rate) (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).**
488
+ 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
489
 
449
490
  ### Explore your own Portfolio
450
491
 
@@ -479,11 +520,14 @@ The table below shows one of the functionalities of the Portfolio module but is
479
520
 
480
521
  In which the weights and returns can be depicted as follows:
481
522
 
482
- ![Portfolio](https://github.com/user-attachments/assets/a5e05df5-a76a-42fa-bb30-f640cd48da62)
523
+ <picture>
524
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/portfolio-dark.png">
525
+ <img alt="Portfolio" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/portfolio-light.png">
526
+ </picture>
483
527
 
484
528
  ### Applying Econometric Techniques
485
529
 
486
- The `econometrics` module provides [regression](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_ols), [hypothesis testing](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_jarque_bera_test), [unit root and cointegration](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_augmented_dickey_fuller), [Granger causality](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_granger_causality) and [panel data](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_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`.
530
+ 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
531
 
488
532
  ```python
489
533
  # AAPL is the Toolkit's first ticker, so it's the default dependent ticker;
@@ -507,7 +551,14 @@ Regressing Apple's returns on a mix of its chip suppliers, megacap peers and two
507
551
  | XOM | -0.0291 | 0.0373 | -0.7799 | 0.4364 |
508
552
  | PG | 0.2858 | 0.0707 | 4.0393 | 0.0001 |
509
553
 
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#get_augmented_dickey_fuller) (ADF, KPSS, Phillips-Perron), [cointegration and Granger causality](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_engle_granger_cointegration), [panel data estimators](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_fixed_effects) (Fixed/Random Effects), [causal inference](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_propensity_score_matching) (IV-2SLS, Difference-in-Differences, Regression Discontinuity, Propensity Score Matching, Synthetic Control) and [time-series forecasting](https://www.jeroenbouma.com/projects/financetoolkit/docs/econometrics#get_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).**
554
+ And below each coefficient is shown with its 95% confidence interval, with stars marking how significant it is.
555
+
556
+ <picture>
557
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/econometrics-dark.png">
558
+ <img alt="Econometrics" src="https://raw.githubusercontent.com/JerBouma/FinanceToolkit/main/assets/readme/econometrics-light.png">
559
+ </picture>
560
+
561
+ Only `QCOM`, `SWKS`, `MSFT`, `GOOGL` and `PG` 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
562
 
512
563
  # MCP Server
513
564
 
@@ -570,9 +621,11 @@ When looking at a company such as Hyundai Motor Company (ticker: 005380.KS), you
570
621
 
571
622
  Most functions will have the option to define the `trailing` parameter. This lets you define the number of periods that you want to use to calculate the trailing metrics. For example, if you want to calculate the trailing 12-month (TTM) Price-to-Earnings Ratio, you can set `trailing=4` when you have set `quarterly=True` in the Toolkit initialization. The same goes for growth metrics which can be calculated by setting `growth=True`. This will calculate the growth for each period based on the previous period. This also includes a `lag` parameter in which you can define lagged growth. Furthermore, you can also combine the trailing and growth parameters to get trailing growth. For example, set `trailing=4` and `growth=True` for the Price-to-Earnings Ratio which will then calculate the TTM growth.
572
623
 
573
- > **How can I save the data periodically so that I don't have to retrieve it every single time again?**
624
+ > **Does the Finance Toolkit retrieve the same data every time I run it?**
574
625
 
575
- The Toolkit has the option to work with cached data through `use_cached_data=True` when initializing the Toolkit class. Any data that comes from an external source (financial statements, historical prices, economic indicators, and so on) is then stored in a local SQLite database and reused on the next run. Anything the Toolkit calculates itself is never cached, it is always derived from that data on demand.
626
+ No. Any data that comes from an external source (financial statements, historical prices, economic indicators, yield curves, news and so on) is cached automatically in a local SQLite database and reused on the next run, in the Toolkit as well as in the Economics, Fixed Income, Discovery and Portfolio modules. Anything the Finance Toolkit calculates itself, such as ratios, models and risk metrics, is never cached: it is always derived from that data on demand, so it reflects the latest version of the Finance Toolkit.
627
+
628
+ Cached data does not go stale. Each dataset is retrieved again once it may have changed: prices and financial statements after a day (prices only for the last week, since older bars no longer change), quotes after a minute, company profiles after a month and economic releases according to how often they are published. An answer that a source has no data, such as the ETF holdings of a company, is cached as well, while a failed request, such as a rate limit, is not.
576
629
 
577
630
  The cache keeps track of what it already holds per ticker and per date range, which means changing a parameter does not throw the rest away:
578
631
 
@@ -580,7 +633,20 @@ The cache keeps track of what it already holds per ticker and per date range, wh
580
633
  - Widening the period only retrieves the years that were missing.
581
634
  - Adding a ticker only retrieves that one ticker.
582
635
 
583
- By default the database lives in your user configuration directory, which is the same one the MCP server uses, so both share a single cache. You can also select a specific location by providing a string to the `use_cached_data` parameter, which will store the database in the provided folder.
636
+ The database lives in your user configuration directory, which is the same one the MCP server uses, so both share a single cache. You can choose where it is stored, or switch caching off:
637
+
638
+ ```python
639
+ from financetoolkit import Economics, Toolkit
640
+
641
+ # Store the cache in a specific folder
642
+ toolkit = Toolkit(["AAPL", "MSFT"], use_cached_data="datasets")
643
+
644
+ # Retrieve everything every time
645
+ toolkit = Toolkit(["AAPL", "MSFT"], use_cached_data=False)
646
+ economics = Economics(use_cached_data=False)
647
+ ```
648
+
649
+ Setting the `FINANCE_TOOLKIT_CACHE_ENABLED` environment variable to `0` switches caching off by default everywhere, which suits environments where nothing should be written to disk, such as a continuous integration job. `FINANCE_TOOLKIT_CACHE_DB` moves the shared database to another file.
584
650
 
585
651
  To see what is currently stored, use `toolkit.get_cache_contents()`. It reports the entries grouped by source and dataset:
586
652
 
@@ -610,7 +676,59 @@ This is related to the `benchmark_ticker` parameter which is set to "SPY" (S&P 5
610
676
 
611
677
  > **Data collection seems to be slow, what could be the issue?**
612
678
 
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. As the Finance Toolkit makes use of threading, initializing the Toolkit with a single ticker will result in a slow process. This is because the Toolkit will have to wait for the previous request to finish before it can start the next one. Therefore, it is recommended to initialize the Toolkit with all tickers you want to analyze. 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.
679
+ 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.
680
+
681
+ > **I work behind a corporate proxy and get "certificate verify failed" errors, how do I solve this?**
682
+
683
+ Many corporate networks inspect encrypted traffic. The proxy opens every HTTPS connection on your behalf and presents a certificate signed by your company's own root certificate instead of the website's real one. Your browser trusts that root certificate because IT installed it on your computer, but Python does not: it checks certificates against its own list of public certificate authorities (the `certifi` package), which does not include your company's. The result is an error such as `SSLError: certificate verify failed: self-signed certificate in certificate chain`.
684
+
685
+ When a certificate cannot be verified, the Finance Toolkit first retries with your operating system's certificate file, where Python can find one (usually on Linux, not on Windows). If that fails as well, what happens next depends on whether the request carries an API key:
686
+
687
+ - Requests without an API key, such as those to the ECB, Eurostat or the BIS, are retried without verifying the certificate. A warning is logged when this happens.
688
+ - Requests with an API key, such as those to FinancialModelingPrep and FRED, are **not** retried without verification. The key is part of the web address, so anyone who can intercept an unverified connection could read it and use your subscription. The request fails with an error that explains the options below.
689
+
690
+ The recommended solution is to tell Python to trust your company's root certificate, so every connection stays verified:
691
+
692
+ 1. Obtain the root certificate as a `.pem` (or `.crt`) file. Your IT department can usually provide it. You can also export it from your browser by opening the certificate details of any HTTPS website and exporting the top certificate in the chain ("Base-64 encoded" on Windows).
693
+ 2. Combine it with Python's public certificates. The next step replaces Python's list rather than adding to it, so without the public certificates every connection that does not go through the proxy would fail:
694
+
695
+ ```bash
696
+ # Prints the location of Python's public certificates
697
+ python -c "import certifi; print(certifi.where())"
698
+
699
+ # macOS and Linux: combine both into one file
700
+ cat /path/printed/above/cacert.pem /path/to/company-root.pem > ~/combined-certificates.pem
701
+ ```
702
+
703
+ On Windows you can open both files in a text editor and paste the company certificate at the end of a copy of `cacert.pem`.
704
+
705
+ 3. Point `REQUESTS_CA_BUNDLE` to the combined file before using the Finance Toolkit:
706
+
707
+ ```bash
708
+ # macOS and Linux, e.g. in ~/.bashrc or ~/.zshrc
709
+ export REQUESTS_CA_BUNDLE=~/combined-certificates.pem
710
+
711
+ # Windows (PowerShell), for every window opened afterwards
712
+ setx REQUESTS_CA_BUNDLE "C:\Users\you\combined-certificates.pem"
713
+ ```
714
+
715
+ `setx` does not change the window it runs in, so open a new terminal (or restart your editor) afterwards.
716
+
717
+ Or set it within Python, before the first request:
718
+
719
+ ```python
720
+ import os
721
+
722
+ os.environ["REQUESTS_CA_BUNDLE"] = "/path/to/combined-certificates.pem"
723
+
724
+ from financetoolkit import Toolkit
725
+ ```
726
+
727
+ When you use the MCP server, add the variable to the `env` section of the server in your AI assistant's configuration instead.
728
+
729
+ Alternatively, if your company's root certificate is already installed in your operating system (which is usually the case on managed Windows and macOS computers), the `truststore` package lets Python use the operating system's certificates directly. Install it with `pip install truststore` and run `import truststore; truststore.inject_into_ssl()` at the start of your script.
730
+
731
+ If none of this is possible, you can accept the risk and allow requests with an API key to be sent without verification by setting `FINANCETOOLKIT_ALLOW_UNVERIFIED_SSL=1` in the same way as above. Only do so on a network you trust: the connection is then encrypted to whoever answers it, which may not be the website you think you are talking to, and your API key is readable to them.
614
732
 
615
733
  > **Are you part of FinancialModelingPrep?**
616
734