quantlite 1.7.0__tar.gz → 1.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. {quantlite-1.7.0/src/quantlite.egg-info → quantlite-1.7.1}/PKG-INFO +1 -1
  2. {quantlite-1.7.0 → quantlite-1.7.1}/pyproject.toml +1 -1
  3. quantlite-1.7.1/src/quantlite/__init__.py +167 -0
  4. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/core/types.py +5 -9
  5. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/metrics.py +5 -1
  6. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/risk/metrics.py +8 -12
  7. {quantlite-1.7.0 → quantlite-1.7.1/src/quantlite.egg-info}/PKG-INFO +1 -1
  8. quantlite-1.7.0/src/quantlite/__init__.py +0 -137
  9. {quantlite-1.7.0 → quantlite-1.7.1}/LICENSE +0 -0
  10. {quantlite-1.7.0 → quantlite-1.7.1}/README.md +0 -0
  11. {quantlite-1.7.0 → quantlite-1.7.1}/setup.cfg +0 -0
  12. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/alerts/__init__.py +0 -0
  13. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/antifragile/__init__.py +0 -0
  14. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/backtesting/__init__.py +0 -0
  15. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/backtesting/analysis.py +0 -0
  16. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/backtesting/engine.py +0 -0
  17. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/backtesting/legacy.py +0 -0
  18. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/backtesting/signals.py +0 -0
  19. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/benchmark/__init__.py +0 -0
  20. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/benchmark/compare.py +0 -0
  21. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/benchmark/runner.py +0 -0
  22. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/benchmark/speed.py +0 -0
  23. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/benchmark/tail_events.py +0 -0
  24. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/contagion/__init__.py +0 -0
  25. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/core/__init__.py +0 -0
  26. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/crypto/__init__.py +0 -0
  27. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/crypto/exchange.py +0 -0
  28. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/crypto/onchain.py +0 -0
  29. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/crypto/stablecoin.py +0 -0
  30. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/__init__.py +0 -0
  31. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/base.py +0 -0
  32. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/cache.py +0 -0
  33. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/crypto.py +0 -0
  34. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/fred.py +0 -0
  35. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/local.py +0 -0
  36. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/registry.py +0 -0
  37. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/stream.py +0 -0
  38. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data/yahoo.py +0 -0
  39. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/data_generation.py +0 -0
  40. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/dependency/__init__.py +0 -0
  41. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/dependency/clustering.py +0 -0
  42. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/dependency/copulas.py +0 -0
  43. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/dependency/correlation.py +0 -0
  44. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/distributions/__init__.py +0 -0
  45. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/distributions/fat_tails.py +0 -0
  46. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/diversification/__init__.py +0 -0
  47. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/ergodicity/__init__.py +0 -0
  48. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/explain/__init__.py +0 -0
  49. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/explain/attribution.py +0 -0
  50. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/explain/audit.py +0 -0
  51. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/explain/narratives.py +0 -0
  52. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/explain/whatif.py +0 -0
  53. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/factors/__init__.py +0 -0
  54. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/factors/classical.py +0 -0
  55. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/factors/custom.py +0 -0
  56. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/factors/tail_risk.py +0 -0
  57. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/forensics/__init__.py +0 -0
  58. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/instruments/__init__.py +0 -0
  59. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/instruments/bond_pricing.py +0 -0
  60. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/instruments/exotic_options.py +0 -0
  61. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/instruments/option_pricing.py +0 -0
  62. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/monte_carlo.py +0 -0
  63. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/network/__init__.py +0 -0
  64. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/overfit/__init__.py +0 -0
  65. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/pipeline.py +0 -0
  66. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/__init__.py +0 -0
  67. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/dynamic_kelly.py +0 -0
  68. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/ensemble.py +0 -0
  69. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/optimisation.py +0 -0
  70. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/rebalancing.py +0 -0
  71. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/regime_bl.py +0 -0
  72. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/tail_risk_parity.py +0 -0
  73. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/portfolio/walkforward.py +0 -0
  74. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regime_integration/__init__.py +0 -0
  75. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regime_integration/portfolio.py +0 -0
  76. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regime_integration/reporting.py +0 -0
  77. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regime_integration/risk.py +0 -0
  78. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regimes/__init__.py +0 -0
  79. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regimes/changepoint.py +0 -0
  80. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regimes/conditional.py +0 -0
  81. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regimes/hmm.py +0 -0
  82. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/regimes/online.py +0 -0
  83. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/report/__init__.py +0 -0
  84. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/report/html_renderer.py +0 -0
  85. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/report/pdf_renderer.py +0 -0
  86. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/report/sections.py +0 -0
  87. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/report/tearsheet.py +0 -0
  88. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/resample/__init__.py +0 -0
  89. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/risk/__init__.py +0 -0
  90. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/risk/evt.py +0 -0
  91. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/scenarios/__init__.py +0 -0
  92. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/score/__init__.py +0 -0
  93. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/score/artifact.py +0 -0
  94. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/score/engine.py +0 -0
  95. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/score/integrity.py +0 -0
  96. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/score/monitoring.py +0 -0
  97. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/score/provenance.py +0 -0
  98. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/simulation/__init__.py +0 -0
  99. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/simulation/copula_mc.py +0 -0
  100. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/simulation/evt_simulation.py +0 -0
  101. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/simulation/regime_mc.py +0 -0
  102. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/visualisation.py +0 -0
  103. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/__init__.py +0 -0
  104. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/alerts.py +0 -0
  105. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/allocation.py +0 -0
  106. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/benchmark.py +0 -0
  107. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/dependency.py +0 -0
  108. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/explain.py +0 -0
  109. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/online_regimes.py +0 -0
  110. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/plotly_backend/__init__.py +0 -0
  111. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/plotly_backend/dependency.py +0 -0
  112. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/plotly_backend/portfolio.py +0 -0
  113. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/plotly_backend/regimes.py +0 -0
  114. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/plotly_backend/risk.py +0 -0
  115. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/plotly_backend/theme.py +0 -0
  116. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/portfolio.py +0 -0
  117. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/regimes.py +0 -0
  118. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/risk.py +0 -0
  119. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/streaming.py +0 -0
  120. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite/viz/theme.py +0 -0
  121. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite.egg-info/SOURCES.txt +0 -0
  122. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite.egg-info/dependency_links.txt +0 -0
  123. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite.egg-info/requires.txt +0 -0
  124. {quantlite-1.7.0 → quantlite-1.7.1}/src/quantlite.egg-info/top_level.txt +0 -0
  125. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_alerts.py +0 -0
  126. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_allocation_engine.py +0 -0
  127. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_analysis.py +0 -0
  128. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_antifragile.py +0 -0
  129. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_backtesting.py +0 -0
  130. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_benchmarks.py +0 -0
  131. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_changepoint.py +0 -0
  132. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_clustering.py +0 -0
  133. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_conditional.py +0 -0
  134. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_contagion.py +0 -0
  135. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_copulas.py +0 -0
  136. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_correlation.py +0 -0
  137. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_crypto_exchange.py +0 -0
  138. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_crypto_onchain.py +0 -0
  139. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_crypto_stablecoin.py +0 -0
  140. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_data_connectors.py +0 -0
  141. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_data_generation.py +0 -0
  142. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_diversification.py +0 -0
  143. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_engine.py +0 -0
  144. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_ergodicity.py +0 -0
  145. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_evt.py +0 -0
  146. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_explainability.py +0 -0
  147. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_factors_classical.py +0 -0
  148. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_factors_custom.py +0 -0
  149. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_factors_tail_risk.py +0 -0
  150. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_fat_tails.py +0 -0
  151. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_forensics.py +0 -0
  152. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_hmm.py +0 -0
  153. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_instruments.py +0 -0
  154. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_metrics.py +0 -0
  155. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_monitoring.py +0 -0
  156. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_monte_carlo.py +0 -0
  157. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_network.py +0 -0
  158. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_online_regime.py +0 -0
  159. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_optimisation.py +0 -0
  160. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_overfit.py +0 -0
  161. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_pipeline.py +0 -0
  162. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_plotly_viz.py +0 -0
  163. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_provenance.py +0 -0
  164. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_rebalancing.py +0 -0
  165. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_regime_integration.py +0 -0
  166. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_report.py +0 -0
  167. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_resample.py +0 -0
  168. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_risk_metrics.py +0 -0
  169. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_scenarios.py +0 -0
  170. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_score.py +0 -0
  171. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_signals.py +0 -0
  172. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_sim_copula.py +0 -0
  173. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_sim_evt.py +0 -0
  174. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_sim_regime.py +0 -0
  175. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_stream.py +0 -0
  176. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_visualisation.py +0 -0
  177. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_viz.py +0 -0
  178. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_viz_dependency.py +0 -0
  179. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_viz_portfolio.py +0 -0
  180. {quantlite-1.7.0 → quantlite-1.7.1}/tests/test_viz_regimes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantlite
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: A fat-tail-native quantitative finance toolkit: EVT, risk metrics, and honest modelling for markets that bite.
5
5
  Author-email: Prasant Sudhakaran <code@prasant.net>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantlite"
7
- version = "1.7.0"
7
+ version = "1.7.1"
8
8
  description = "A fat-tail-native quantitative finance toolkit: EVT, risk metrics, and honest modelling for markets that bite."
9
9
  requires-python = ">=3.9"
10
10
  license = { file = "LICENSE" }
@@ -0,0 +1,167 @@
1
+ """QuantLite: a fat-tail-native quantitative finance toolkit.
2
+
3
+ Provides stochastic process generators, option and bond pricing,
4
+ risk metrics, extreme value theory, fat-tailed distributions,
5
+ portfolio optimisation, multi-asset backtesting, and
6
+ Stephen Few-inspired visualisation.
7
+
8
+ Submodules and public names are imported lazily (PEP 562): accessing
9
+ ``quantlite.run_backtest`` or ``quantlite.score`` imports the backing module
10
+ on first use. This keeps light entry points light -- importing
11
+ ``quantlite.score`` does not pull in pandas or matplotlib -- while preserving
12
+ the full ``from quantlite import X`` and ``quantlite.X`` public API.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import importlib
18
+ from typing import Any
19
+
20
+ __version__ = "1.7.1"
21
+
22
+ # Public names mapped to the module that defines them, for lazy loading.
23
+ _ATTR_SOURCES = {
24
+ # Data generation
25
+ "geometric_brownian_motion": "quantlite.data_generation",
26
+ "correlated_gbm": "quantlite.data_generation",
27
+ "ornstein_uhlenbeck": "quantlite.data_generation",
28
+ "merton_jump_diffusion": "quantlite.data_generation",
29
+ # Instruments
30
+ "black_scholes_call": "quantlite.instruments.option_pricing",
31
+ "black_scholes_put": "quantlite.instruments.option_pricing",
32
+ "black_scholes_greeks": "quantlite.instruments.option_pricing",
33
+ "bond_price": "quantlite.instruments.bond_pricing",
34
+ "bond_yield_to_maturity": "quantlite.instruments.bond_pricing",
35
+ # Metrics
36
+ "annualised_return": "quantlite.metrics",
37
+ "annualised_volatility": "quantlite.metrics",
38
+ "sharpe_ratio": "quantlite.metrics",
39
+ "max_drawdown": "quantlite.metrics",
40
+ # Backtesting
41
+ "run_backtest": "quantlite.backtesting",
42
+ "BacktestConfig": "quantlite.backtesting",
43
+ "BacktestContext": "quantlite.backtesting",
44
+ "BacktestResult": "quantlite.backtesting",
45
+ "RiskLimits": "quantlite.backtesting",
46
+ "SlippageModel": "quantlite.backtesting",
47
+ # Visualisation
48
+ "plot_time_series": "quantlite.visualisation",
49
+ # Dream API (pipeline)
50
+ "fetch": "quantlite.pipeline",
51
+ "detect_regimes": "quantlite.pipeline",
52
+ "construct_portfolio": "quantlite.pipeline",
53
+ "backtest": "quantlite.pipeline",
54
+ "tearsheet": "quantlite.pipeline",
55
+ # Streaming & alerts (v1.1)
56
+ "AlertManager": "quantlite.alerts",
57
+ "AlertRule": "quantlite.alerts",
58
+ "Alert": "quantlite.alerts",
59
+ "PriceStream": "quantlite.data.stream",
60
+ "PriceTick": "quantlite.data.stream",
61
+ "create_stream": "quantlite.data.stream",
62
+ "stream": "quantlite.data.stream",
63
+ "OnlineRegimeDetector": "quantlite.regimes.online",
64
+ "RegimeUpdate": "quantlite.regimes.online",
65
+ }
66
+
67
+ # Names whose attribute on the source module differs from the public name.
68
+ _ALIASES = {"stream": "create_stream"}
69
+
70
+ __all__ = [
71
+ # Data generation
72
+ "geometric_brownian_motion",
73
+ "correlated_gbm",
74
+ "ornstein_uhlenbeck",
75
+ "merton_jump_diffusion",
76
+ # Instruments
77
+ "black_scholes_call",
78
+ "black_scholes_put",
79
+ "black_scholes_greeks",
80
+ "bond_price",
81
+ "bond_yield_to_maturity",
82
+ # Metrics
83
+ "annualised_return",
84
+ "annualised_volatility",
85
+ "sharpe_ratio",
86
+ "max_drawdown",
87
+ # Backtesting
88
+ "run_backtest",
89
+ "BacktestConfig",
90
+ "BacktestContext",
91
+ "BacktestResult",
92
+ "RiskLimits",
93
+ "SlippageModel",
94
+ # Visualisation
95
+ "plot_time_series",
96
+ # Ergodicity economics
97
+ "ergodicity",
98
+ # Antifragility framework
99
+ "antifragile",
100
+ # Scenario engine
101
+ "scenarios",
102
+ # Strategy forensics
103
+ "forensics",
104
+ # Overfitting detection
105
+ "overfit",
106
+ # Resampled backtesting
107
+ "resample",
108
+ # Contagion metrics
109
+ "contagion",
110
+ # Network risk
111
+ "network",
112
+ # Diversification analysis
113
+ "diversification",
114
+ # Crypto-native risk
115
+ "crypto",
116
+ # Fat-tail Monte Carlo simulation
117
+ "simulation",
118
+ # Regime-aware integration
119
+ "regime_integration",
120
+ # Dream API (pipeline)
121
+ "fetch",
122
+ "detect_regimes",
123
+ "construct_portfolio",
124
+ "backtest",
125
+ "tearsheet",
126
+ # Streaming & alerts (v1.1)
127
+ "AlertManager",
128
+ "AlertRule",
129
+ "Alert",
130
+ "PriceStream",
131
+ "PriceTick",
132
+ "create_stream",
133
+ "stream",
134
+ "OnlineRegimeDetector",
135
+ "RegimeUpdate",
136
+ # Benchmarking (v1.5)
137
+ "benchmark",
138
+ # QuantLite Score (v1.6)
139
+ "score",
140
+ ]
141
+
142
+
143
+ def __getattr__(name: str) -> Any:
144
+ """Lazily import a public name or submodule on first access (PEP 562).
145
+
146
+ Public names listed in ``__all__`` resolve to their defining module; any
147
+ other name is tried as a submodule, preserving the eager package's
148
+ behaviour of exposing ``quantlite.<submodule>`` without an explicit
149
+ import.
150
+ """
151
+ source = _ATTR_SOURCES.get(name)
152
+ if source is not None:
153
+ module = importlib.import_module(source)
154
+ value = getattr(module, _ALIASES.get(name, name))
155
+ globals()[name] = value
156
+ return value
157
+ try:
158
+ module = importlib.import_module(f"{__name__}.{name}")
159
+ except ModuleNotFoundError:
160
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
161
+ globals()[name] = module
162
+ return module
163
+
164
+
165
+ def __dir__() -> list[str]:
166
+ """List the lazily exported names for tab completion and introspection."""
167
+ return sorted(__all__)
@@ -7,8 +7,10 @@ immutability, dot-access, and clear ``repr`` output.
7
7
  from __future__ import annotations
8
8
 
9
9
  from dataclasses import dataclass
10
+ from typing import TYPE_CHECKING
10
11
 
11
- import pandas as pd
12
+ if TYPE_CHECKING:
13
+ import pandas as pd
12
14
 
13
15
  __all__ = [
14
16
  "BacktestResult",
@@ -82,10 +84,7 @@ class DrawdownInfo:
82
84
  end_idx: int
83
85
 
84
86
  def __repr__(self) -> str:
85
- return (
86
- f"DrawdownInfo(max_dd={self.max_drawdown:.4f}, "
87
- f"duration={self.duration} periods)"
88
- )
87
+ return f"DrawdownInfo(max_dd={self.max_drawdown:.4f}, duration={self.duration} periods)"
89
88
 
90
89
 
91
90
  @dataclass(frozen=True)
@@ -114,10 +113,7 @@ class GEVFit:
114
113
  scale: float # sigma
115
114
 
116
115
  def __repr__(self) -> str:
117
- return (
118
- f"GEVFit(shape={self.shape:.4f}, loc={self.loc:.4f}, "
119
- f"scale={self.scale:.4f})"
120
- )
116
+ return f"GEVFit(shape={self.shape:.4f}, loc={self.loc:.4f}, scale={self.scale:.4f})"
121
117
 
122
118
 
123
119
  @dataclass(frozen=True)
@@ -2,8 +2,12 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import TYPE_CHECKING
6
+
5
7
  import numpy as np
6
- import pandas as pd
8
+
9
+ if TYPE_CHECKING:
10
+ import pandas as pd
7
11
 
8
12
  __all__ = [
9
13
  "annualised_return",
@@ -5,8 +5,12 @@ All functions accept NumPy arrays or pandas Series of simple returns.
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
+ from typing import TYPE_CHECKING
9
+
8
10
  import numpy as np
9
- import pandas as pd
11
+
12
+ if TYPE_CHECKING:
13
+ import pandas as pd
10
14
  from scipy import stats
11
15
 
12
16
  from ..core.types import DrawdownInfo, ReturnMoments
@@ -63,20 +67,14 @@ def value_at_risk(
63
67
  if method == "cornish-fisher":
64
68
  s = float(stats.skew(arr))
65
69
  k = float(stats.kurtosis(arr)) # excess kurtosis
66
- z_cf = (
67
- z
68
- + (z**2 - 1) * s / 6
69
- + (z**3 - 3 * z) * k / 24
70
- - (2 * z**3 - 5 * z) * s**2 / 36
71
- )
70
+ z_cf = z + (z**2 - 1) * s / 6 + (z**3 - 3 * z) * k / 24 - (2 * z**3 - 5 * z) * s**2 / 36
72
71
  return float(mu + sigma * z_cf)
73
72
 
74
73
  if method == "evt":
75
74
  return _evt_gpd_var(arr, alpha)
76
75
 
77
76
  raise ValueError(
78
- f"Unknown method: {method}. "
79
- "Use 'historical', 'parametric', 'cornish-fisher', or 'evt'."
77
+ f"Unknown method: {method}. Use 'historical', 'parametric', 'cornish-fisher', or 'evt'."
80
78
  )
81
79
 
82
80
 
@@ -120,9 +118,7 @@ def _evt_gpd_var(
120
118
  shape, _, gpd_scale = stats.genpareto.fit(exceedances, floc=0)
121
119
  n = len(losses)
122
120
  n_exceed = len(exceedances)
123
- var_loss = threshold + (gpd_scale / shape) * (
124
- (n / n_exceed * alpha) ** (-shape) - 1
125
- )
121
+ var_loss = threshold + (gpd_scale / shape) * ((n / n_exceed * alpha) ** (-shape) - 1)
126
122
  return float(-var_loss)
127
123
 
128
124
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantlite
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: A fat-tail-native quantitative finance toolkit: EVT, risk metrics, and honest modelling for markets that bite.
5
5
  Author-email: Prasant Sudhakaran <code@prasant.net>
6
6
  License: MIT License
@@ -1,137 +0,0 @@
1
- """QuantLite: a fat-tail-native quantitative finance toolkit.
2
-
3
- Provides stochastic process generators, option and bond pricing,
4
- risk metrics, extreme value theory, fat-tailed distributions,
5
- portfolio optimisation, multi-asset backtesting, and
6
- Stephen Few-inspired visualisation.
7
- """
8
-
9
- __version__ = "1.6.0"
10
-
11
- from .backtesting import (
12
- BacktestConfig,
13
- BacktestContext,
14
- BacktestResult,
15
- RiskLimits,
16
- SlippageModel,
17
- run_backtest,
18
- )
19
- from .data_generation import (
20
- correlated_gbm,
21
- geometric_brownian_motion,
22
- merton_jump_diffusion,
23
- ornstein_uhlenbeck,
24
- )
25
- from .instruments.bond_pricing import bond_price, bond_yield_to_maturity
26
- from .instruments.option_pricing import (
27
- black_scholes_call,
28
- black_scholes_greeks,
29
- black_scholes_put,
30
- )
31
- from .metrics import annualised_return, annualised_volatility, max_drawdown, sharpe_ratio
32
- from .visualisation import plot_time_series
33
-
34
- __all__ = [
35
- # Data generation
36
- "geometric_brownian_motion",
37
- "correlated_gbm",
38
- "ornstein_uhlenbeck",
39
- "merton_jump_diffusion",
40
- # Instruments
41
- "black_scholes_call",
42
- "black_scholes_put",
43
- "black_scholes_greeks",
44
- "bond_price",
45
- "bond_yield_to_maturity",
46
- # Metrics
47
- "annualised_return",
48
- "annualised_volatility",
49
- "sharpe_ratio",
50
- "max_drawdown",
51
- # Backtesting
52
- "run_backtest",
53
- "BacktestConfig",
54
- "BacktestContext",
55
- "BacktestResult",
56
- "RiskLimits",
57
- "SlippageModel",
58
- # Visualisation
59
- "plot_time_series",
60
- # Ergodicity economics
61
- "ergodicity",
62
- # Antifragility framework
63
- "antifragile",
64
- # Scenario engine
65
- "scenarios",
66
- # Strategy forensics
67
- "forensics",
68
- # Overfitting detection
69
- "overfit",
70
- # Resampled backtesting
71
- "resample",
72
- # Contagion metrics
73
- "contagion",
74
- # Network risk
75
- "network",
76
- # Diversification analysis
77
- "diversification",
78
- # Crypto-native risk
79
- "crypto",
80
- # Fat-tail Monte Carlo simulation
81
- "simulation",
82
- # Regime-aware integration
83
- "regime_integration",
84
- # Dream API (pipeline)
85
- "fetch",
86
- "detect_regimes",
87
- "construct_portfolio",
88
- "backtest",
89
- "tearsheet",
90
- # Streaming & alerts (v1.1)
91
- "AlertManager",
92
- "AlertRule",
93
- "Alert",
94
- "PriceStream",
95
- "PriceTick",
96
- "create_stream",
97
- "OnlineRegimeDetector",
98
- "RegimeUpdate",
99
- # Benchmarking (v1.5)
100
- "benchmark",
101
- # QuantLite Score (v1.6)
102
- "score",
103
- ]
104
-
105
- from . import ( # noqa: E402
106
- antifragile,
107
- contagion,
108
- crypto,
109
- diversification,
110
- ergodicity,
111
- forensics,
112
- network,
113
- overfit,
114
- regime_integration,
115
- resample,
116
- scenarios,
117
- simulation,
118
- )
119
-
120
- # v1.1: Streaming, online regimes, alerts
121
- from .alerts import Alert, AlertManager, AlertRule # noqa: E402
122
- from .data.stream import PriceStream, PriceTick, create_stream # noqa: E402
123
- from .pipeline import ( # noqa: E402
124
- backtest,
125
- construct_portfolio,
126
- detect_regimes,
127
- tearsheet,
128
- )
129
- from .pipeline import fetch as fetch # noqa: E402
130
- from .regimes.online import OnlineRegimeDetector, RegimeUpdate # noqa: E402
131
-
132
- # Convenience alias
133
- stream = create_stream
134
-
135
- # v1.5: Benchmarking suite
136
- # v1.6: QuantLite Score (open scoring spec for track records)
137
- from . import benchmark, score # noqa: E402
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes