financetoolkit 2.2.1__tar.gz → 2.2.3__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 (201) hide show
  1. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/PKG-INFO +156 -38
  2. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/README.md +151 -36
  3. financetoolkit-2.2.3/financetoolkit/__init__.py +54 -0
  4. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/cache_controller.py +104 -16
  5. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/frame_model.py +55 -0
  6. financetoolkit-2.2.3/financetoolkit/cache/policy_model.py +282 -0
  7. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/ticker_model.py +37 -1
  8. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/currencies_model.py +242 -0
  9. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/discovery/discovery_controller.py +612 -255
  10. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/discovery/discovery_model.py +619 -31
  11. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/causal_inference_model.py +32 -32
  12. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/econometrics_controller.py +516 -293
  13. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/panel_data_model.py +14 -14
  14. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/regression_model.py +4 -4
  15. financetoolkit-2.2.3/financetoolkit/economics/bis_model.py +269 -0
  16. financetoolkit-2.2.3/financetoolkit/economics/bls_model.py +106 -0
  17. financetoolkit-2.2.3/financetoolkit/economics/boe_model.py +508 -0
  18. financetoolkit-2.2.3/financetoolkit/economics/boj_model.py +111 -0
  19. financetoolkit-2.2.3/financetoolkit/economics/cboe_model.py +140 -0
  20. financetoolkit-2.2.3/financetoolkit/economics/dnb_model.py +272 -0
  21. financetoolkit-2.2.3/financetoolkit/economics/ecb_model.py +405 -0
  22. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/economics/economics_controller.py +3928 -1010
  23. financetoolkit-2.2.3/financetoolkit/economics/eex_model.py +99 -0
  24. financetoolkit-2.2.3/financetoolkit/economics/esrb_model.py +191 -0
  25. financetoolkit-2.2.3/financetoolkit/economics/eurostat_model.py +484 -0
  26. financetoolkit-2.2.3/financetoolkit/economics/fmp_model.py +333 -0
  27. financetoolkit-2.2.3/financetoolkit/economics/frb_model.py +276 -0
  28. financetoolkit-2.2.3/financetoolkit/economics/freddie_mac_model.py +50 -0
  29. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/economics/gmdb_model.py +213 -28
  30. financetoolkit-2.2.3/financetoolkit/economics/helpers.py +524 -0
  31. financetoolkit-2.2.3/financetoolkit/economics/ibge_model.py +70 -0
  32. financetoolkit-2.2.3/financetoolkit/economics/imf_model.py +200 -0
  33. financetoolkit-2.2.3/financetoolkit/economics/macrohistory_model.py +97 -0
  34. financetoolkit-2.2.3/financetoolkit/economics/mof_model.py +80 -0
  35. financetoolkit-2.2.3/financetoolkit/economics/nber_model.py +81 -0
  36. financetoolkit-2.2.3/financetoolkit/economics/ngfs_model.py +317 -0
  37. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/economics/oecd_model.py +36 -0
  38. financetoolkit-2.2.3/financetoolkit/economics/ons_model.py +139 -0
  39. financetoolkit-2.2.3/financetoolkit/economics/sbj_model.py +168 -0
  40. financetoolkit-2.2.3/financetoolkit/economics/shiller_model.py +122 -0
  41. financetoolkit-2.2.3/financetoolkit/economics/stoxx_model.py +92 -0
  42. financetoolkit-2.2.3/financetoolkit/economics/treasury_model.py +240 -0
  43. financetoolkit-2.2.3/financetoolkit/fixedincome/boc_model.py +91 -0
  44. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/bond_model.py +73 -37
  45. financetoolkit-2.2.3/financetoolkit/fixedincome/bundesbank_model.py +556 -0
  46. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/derivative_model.py +38 -7
  47. financetoolkit-2.2.3/financetoolkit/fixedincome/eiopa_model.py +434 -0
  48. financetoolkit-2.2.3/financetoolkit/fixedincome/esma_model.py +239 -0
  49. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/fixedincome_controller.py +1958 -298
  50. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/fred_model.py +194 -0
  51. financetoolkit-2.2.3/financetoolkit/fixedincome/norgesbank_model.py +64 -0
  52. financetoolkit-2.2.3/financetoolkit/fixedincome/rba_model.py +134 -0
  53. financetoolkit-2.2.3/financetoolkit/fixedincome/riksbank_model.py +164 -0
  54. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fmp_model.py +1217 -13
  55. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fundamentals_model.py +36 -3
  56. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/helpers.py +55 -9
  57. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/historical_model.py +275 -118
  58. financetoolkit-2.2.3/financetoolkit/mcp_server/analytics_model.py +444 -0
  59. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/auth_model.py +5 -5
  60. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/config.yaml +272 -43
  61. financetoolkit-2.2.3/financetoolkit/mcp_server/diagnostics_model.py +241 -0
  62. financetoolkit-2.2.3/financetoolkit/mcp_server/formatting_model.py +540 -0
  63. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/inspection_controller.py +27 -3
  64. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/mcp_controller.py +104 -25
  65. financetoolkit-2.2.3/financetoolkit/mcp_server/mcpb/manifest.json +178 -0
  66. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/mcpb/pyproject.toml +2 -2
  67. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/provider_model.py +160 -22
  68. financetoolkit-2.2.3/financetoolkit/mcp_server/registry_controller.py +1890 -0
  69. financetoolkit-2.2.3/financetoolkit/mcp_server/tools_model.py +451 -0
  70. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/intrinsic_model.py +12 -2
  71. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/models_controller.py +369 -205
  72. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/wacc_model.py +9 -2
  73. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/binomial_trees_model.py +11 -0
  74. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/black_scholes_model.py +27 -8
  75. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/exotics_model.py +28 -4
  76. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/greeks_model.py +19 -0
  77. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/helpers.py +47 -0
  78. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/options_controller.py +1184 -812
  79. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/options_model.py +200 -14
  80. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/performance/helpers.py +0 -84
  81. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/performance/performance_controller.py +535 -294
  82. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/performance/performance_model.py +147 -50
  83. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/helpers.py +3 -1
  84. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/portfolio_controller.py +147 -134
  85. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/portfolio_model.py +1 -1
  86. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/ratios_controller.py +920 -395
  87. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/cvar_model.py +13 -13
  88. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/garch_model.py +72 -40
  89. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/risk_controller.py +576 -395
  90. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/risk_model.py +95 -46
  91. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/var_model.py +3 -26
  92. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/technicals/momentum_model.py +31 -12
  93. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/technicals/overlap_model.py +75 -35
  94. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/technicals/technicals_controller.py +800 -579
  95. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/technicals/volatility_model.py +58 -48
  96. financetoolkit-2.2.3/financetoolkit/toolkit_controller.py +5792 -0
  97. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/utilities/dataframe_model.py +17 -4
  98. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/utilities/error_model.py +153 -56
  99. financetoolkit-2.2.3/financetoolkit/utilities/excel_model.py +104 -0
  100. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/utilities/requests_model.py +68 -2
  101. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/utilities/statistics_model.py +233 -62
  102. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/utilities/validation_model.py +23 -0
  103. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/yfinance_model.py +43 -32
  104. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/pyproject.toml +6 -3
  105. financetoolkit-2.2.1/financetoolkit/__init__.py +0 -8
  106. financetoolkit-2.2.1/financetoolkit/cache/policy_model.py +0 -135
  107. financetoolkit-2.2.1/financetoolkit/mcp_server/formatting_model.py +0 -212
  108. financetoolkit-2.2.1/financetoolkit/mcp_server/mcpb/manifest.json +0 -182
  109. financetoolkit-2.2.1/financetoolkit/mcp_server/registry_controller.py +0 -893
  110. financetoolkit-2.2.1/financetoolkit/mcp_server/tools_model.py +0 -303
  111. financetoolkit-2.2.1/financetoolkit/technicals/helpers.py +0 -72
  112. financetoolkit-2.2.1/financetoolkit/toolkit_controller.py +0 -4438
  113. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/.gitignore +0 -0
  114. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/LICENSE.txt +0 -0
  115. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/__init__.py +0 -0
  116. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/coverage_model.py +0 -0
  117. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/request_model.py +0 -0
  118. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/serialization_model.py +0 -0
  119. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/cache/sqlite_model.py +0 -0
  120. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/discovery/__init__.py +0 -0
  121. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/__init__.py +0 -0
  122. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/causality_model.py +0 -0
  123. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/cointegration_model.py +0 -0
  124. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/diagnostics_model.py +0 -0
  125. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/event_study_model.py +0 -0
  126. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/fama_macbeth_model.py +0 -0
  127. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/forecast_evaluation_model.py +0 -0
  128. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/hypothesis_testing_model.py +0 -0
  129. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/specification_tests_model.py +0 -0
  130. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/time_series_model.py +0 -0
  131. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/econometrics/unitroot_model.py +0 -0
  132. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/economics/__init__.py +0 -0
  133. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/economics/fred_model.py +0 -0
  134. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/economics/yfinance_model.py +0 -0
  135. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/__init__.py +0 -0
  136. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/ecb_model.py +0 -0
  137. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/euribor_model.py +0 -0
  138. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/fed_model.py +0 -0
  139. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/fmp_model.py +0 -0
  140. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/helpers.py +0 -0
  141. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/fixedincome/yieldcurve_model.py +0 -0
  142. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/__init__.py +0 -0
  143. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/__main__.py +0 -0
  144. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/coercion_model.py +0 -0
  145. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/mcpb/.mcpbignore +0 -0
  146. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/mcpb/LICENSE +0 -0
  147. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/mcpb/README.md +0 -0
  148. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/mcpb/build-mcpb.sh +0 -0
  149. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/mcpb/finance_toolkit_icon.png +0 -0
  150. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/mcp_server/setup_model.py +0 -0
  151. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/__init__.py +0 -0
  152. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/altman_model.py +0 -0
  153. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/beneish_model.py +0 -0
  154. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/dupont_model.py +0 -0
  155. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/enterprise_model.py +0 -0
  156. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/eva_model.py +0 -0
  157. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/fulmer_model.py +0 -0
  158. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/grover_model.py +0 -0
  159. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/growth_model.py +0 -0
  160. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/helpers.py +0 -0
  161. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/ohlson_model.py +0 -0
  162. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/piotroski_model.py +0 -0
  163. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/springate_model.py +0 -0
  164. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/models/zmijewski_model.py +0 -0
  165. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/balance.csv +0 -0
  166. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/balance_yf.csv +0 -0
  167. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/cash.csv +0 -0
  168. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/cash_yf.csv +0 -0
  169. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/income.csv +0 -0
  170. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/income_yf.csv +0 -0
  171. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/statistics.csv +0 -0
  172. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization/statistics_yf.csv +0 -0
  173. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/normalization_model.py +0 -0
  174. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/__init__.py +0 -0
  175. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/risk_neutral_density_model.py +0 -0
  176. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/options/svi_model.py +0 -0
  177. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/performance/__init__.py +0 -0
  178. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/__init__.py +0 -0
  179. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/config.yaml +0 -0
  180. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/example_datasets/example_portfolio.csv +0 -0
  181. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/example_datasets/example_portfolio.xlsx +0 -0
  182. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/portfolio/overview_model.py +0 -0
  183. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/py.typed +0 -0
  184. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/__init__.py +0 -0
  185. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/efficiency_model.py +0 -0
  186. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/helpers.py +0 -0
  187. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/liquidity_model.py +0 -0
  188. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/profitability_model.py +0 -0
  189. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/solvency_model.py +0 -0
  190. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/ratios/valuation_model.py +0 -0
  191. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/__init__.py +0 -0
  192. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/backtesting_model.py +0 -0
  193. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/copula_model.py +0 -0
  194. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/covar_model.py +0 -0
  195. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/evar_model.py +0 -0
  196. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/helpers.py +0 -0
  197. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/market_liquidity_model.py +0 -0
  198. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/risk/realized_volatility_model.py +0 -0
  199. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/technicals/__init__.py +0 -0
  200. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/financetoolkit/technicals/breadth_model.py +0 -0
  201. {financetoolkit-2.2.1 → financetoolkit-2.2.3}/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.1
3
+ Version: 2.2.3
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'
@@ -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,24 +158,32 @@ 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 |
180
+
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>
176
187
 
177
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
 
@@ -201,7 +212,10 @@ 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
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
 
@@ -227,9 +241,12 @@ 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
 
@@ -253,9 +270,12 @@ 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
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
 
@@ -282,9 +302,12 @@ 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
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
 
@@ -312,7 +335,10 @@ 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
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
 
@@ -340,7 +366,10 @@ 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
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
 
@@ -350,7 +379,7 @@ Get the [Value at Risk](https://www.jeroenbouma.com/projects/financetoolkit/docs
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,7 +392,10 @@ 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
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
 
@@ -389,9 +421,12 @@ 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
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
 
@@ -414,9 +449,12 @@ 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
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
 
@@ -442,7 +480,10 @@ 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
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
 
@@ -479,7 +520,10 @@ 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
 
@@ -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/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).**
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
 
@@ -612,6 +678,58 @@ This is related to the `benchmark_ticker` parameter which is set to "SPY" (S&P 5
612
678
 
613
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.
614
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.
732
+
615
733
  > **Are you part of FinancialModelingPrep?**
616
734
 
617
735
  *No, I am not*. I've merely picked them as the primary data provider given that they have a generous free tier and fair pricing compared to other providers. Therefore, any questions related to the data should go through [their contact form](https://site.financialmodelingprep.com/contact). When it comes to any type of ratios, performance metrics, risk metrics, technical indicators or economic indicators, feel free to reach out to me as this is my own work.