rawr-tools 0.1.2__py3-none-any.whl

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 (152) hide show
  1. rawr/__init__.py +34 -0
  2. rawr/api.py +39 -0
  3. rawr/cli/__init__.py +0 -0
  4. rawr/cli/agent_commands.py +1234 -0
  5. rawr/cli/analysis_commands.py +197 -0
  6. rawr/cli/audit_commands.py +85 -0
  7. rawr/cli/audit_store.py +153 -0
  8. rawr/cli/background_runner.py +68 -0
  9. rawr/cli/bootstrap.py +255 -0
  10. rawr/cli/formatters.py +73 -0
  11. rawr/cli/knowledge_commands.py +81 -0
  12. rawr/cli/logging_runtime.py +59 -0
  13. rawr/cli/main.py +129 -0
  14. rawr/cli/market_commands.py +193 -0
  15. rawr/cli/mcp_commands.py +172 -0
  16. rawr/cli/observe_commands.py +125 -0
  17. rawr/cli/plan_commands.py +225 -0
  18. rawr/cli/policy_commands.py +342 -0
  19. rawr/cli/policy_runtime.py +564 -0
  20. rawr/cli/registry.py +1545 -0
  21. rawr/cli/runtime.py +41 -0
  22. rawr/cli/session_commands.py +745 -0
  23. rawr/cli/session_store.py +1309 -0
  24. rawr/cli/time_utils.py +27 -0
  25. rawr/core/__init__.py +1 -0
  26. rawr/core/analysis/__init__.py +0 -0
  27. rawr/core/analysis/indicators.py +70 -0
  28. rawr/core/analysis/screening.py +58 -0
  29. rawr/core/automation/__init__.py +23 -0
  30. rawr/core/automation/actions.py +81 -0
  31. rawr/core/automation/alerts.py +99 -0
  32. rawr/core/automation/auto_trade.py +579 -0
  33. rawr/core/automation/cron.py +68 -0
  34. rawr/core/automation/events.py +123 -0
  35. rawr/core/automation/kill_switch.py +45 -0
  36. rawr/core/automation/loss_tracker.py +62 -0
  37. rawr/core/automation/monitors.py +172 -0
  38. rawr/core/automation/notification_handler.py +90 -0
  39. rawr/core/automation/scheduler.py +136 -0
  40. rawr/core/automation/stop_loss.py +88 -0
  41. rawr/core/automation/trust_level.py +63 -0
  42. rawr/core/config/__init__.py +0 -0
  43. rawr/core/config/auth.py +75 -0
  44. rawr/core/config/env.py +35 -0
  45. rawr/core/config/settings.py +166 -0
  46. rawr/core/data/__init__.py +0 -0
  47. rawr/core/data/cache.py +60 -0
  48. rawr/core/data/dart_client.py +64 -0
  49. rawr/core/data/fred_client.py +90 -0
  50. rawr/core/data/provider.py +21 -0
  51. rawr/core/data/pykrx_provider.py +106 -0
  52. rawr/core/data/yfinance_provider.py +128 -0
  53. rawr/core/deps.py +75 -0
  54. rawr/core/frameworks/__init__.py +25 -0
  55. rawr/core/frameworks/bain.py +383 -0
  56. rawr/core/frameworks/blackrock.py +360 -0
  57. rawr/core/frameworks/bridgewater.py +318 -0
  58. rawr/core/frameworks/citadel.py +329 -0
  59. rawr/core/frameworks/dcf.py +454 -0
  60. rawr/core/frameworks/goldman.py +370 -0
  61. rawr/core/frameworks/harvard.py +349 -0
  62. rawr/core/frameworks/jpmorgan.py +390 -0
  63. rawr/core/frameworks/mckinsey.py +453 -0
  64. rawr/core/frameworks/renaissance.py +350 -0
  65. rawr/core/kis/__init__.py +0 -0
  66. rawr/core/kis/account.py +81 -0
  67. rawr/core/kis/client.py +146 -0
  68. rawr/core/kis/market.py +84 -0
  69. rawr/core/kis/resilience.py +77 -0
  70. rawr/core/kis/token_manager.py +92 -0
  71. rawr/core/kis/trading.py +177 -0
  72. rawr/core/knowledge/__init__.py +13 -0
  73. rawr/core/knowledge/db.py +299 -0
  74. rawr/core/knowledge/graph.py +319 -0
  75. rawr/core/knowledge/journal.py +107 -0
  76. rawr/core/knowledge/research.py +63 -0
  77. rawr/core/knowledge/strategy_kb.py +206 -0
  78. rawr/core/knowledge/watchlist.py +41 -0
  79. rawr/core/krx/__init__.py +0 -0
  80. rawr/core/krx/costs.py +49 -0
  81. rawr/core/krx/market_hours.py +71 -0
  82. rawr/core/krx/price_limits.py +29 -0
  83. rawr/core/krx/tick_size.py +34 -0
  84. rawr/core/llm/__init__.py +5 -0
  85. rawr/core/llm/client.py +108 -0
  86. rawr/core/llm/providers.py +87 -0
  87. rawr/core/llm/schemas.py +37 -0
  88. rawr/core/llm/signal_converter.py +206 -0
  89. rawr/core/models/__init__.py +0 -0
  90. rawr/core/models/fundamental.py +49 -0
  91. rawr/core/models/news.py +34 -0
  92. rawr/core/models/notification.py +33 -0
  93. rawr/core/models/order.py +36 -0
  94. rawr/core/models/portfolio.py +46 -0
  95. rawr/core/models/quant.py +135 -0
  96. rawr/core/models/stock.py +39 -0
  97. rawr/core/news/__init__.py +5 -0
  98. rawr/core/news/disclosure.py +23 -0
  99. rawr/core/news/sentiment.py +27 -0
  100. rawr/core/notifications/__init__.py +10 -0
  101. rawr/core/notifications/rate_limiter.py +45 -0
  102. rawr/core/notifications/router.py +79 -0
  103. rawr/core/notifications/telegram.py +53 -0
  104. rawr/core/notifications/terminal.py +37 -0
  105. rawr/core/plans/__init__.py +11 -0
  106. rawr/core/plans/metrics.py +118 -0
  107. rawr/core/plans/models.py +118 -0
  108. rawr/core/plans/repository.py +70 -0
  109. rawr/core/plans/service.py +344 -0
  110. rawr/core/quant/__init__.py +20 -0
  111. rawr/core/quant/backtest/__init__.py +24 -0
  112. rawr/core/quant/backtest/engine.py +201 -0
  113. rawr/core/quant/backtest/result.py +108 -0
  114. rawr/core/quant/backtest/strategy.py +128 -0
  115. rawr/core/quant/factor_model.py +352 -0
  116. rawr/core/quant/portfolio_risk.py +52 -0
  117. rawr/core/quant/position.py +70 -0
  118. rawr/core/quant/probability.py +42 -0
  119. rawr/core/quant/rawr_score.py +112 -0
  120. rawr/core/quant/risk.py +65 -0
  121. rawr/core/quant/signal.py +194 -0
  122. rawr/core/quant/simulation.py +122 -0
  123. rawr/core/quant/walk_forward.py +173 -0
  124. rawr/core/us/__init__.py +6 -0
  125. rawr/core/us/disclosure_store.py +101 -0
  126. rawr/core/us/edgar_client.py +104 -0
  127. rawr/core/us_market/__init__.py +1 -0
  128. rawr/core/us_market/costs.py +46 -0
  129. rawr/core/us_market/market_hours.py +66 -0
  130. rawr/core/us_market/tick_size.py +29 -0
  131. rawr/mcp/__init__.py +0 -0
  132. rawr/mcp/analysis_tools.py +196 -0
  133. rawr/mcp/automation_tools.py +569 -0
  134. rawr/mcp/backtest_tools.py +242 -0
  135. rawr/mcp/framework_tools.py +452 -0
  136. rawr/mcp/knowledge_tools.py +507 -0
  137. rawr/mcp/market_tools.py +107 -0
  138. rawr/mcp/news_tools.py +288 -0
  139. rawr/mcp/notification_tools.py +83 -0
  140. rawr/mcp/quant_tools.py +392 -0
  141. rawr/mcp/server.py +30 -0
  142. rawr/mcp/signal_tools.py +259 -0
  143. rawr/mcp/system_tools.py +160 -0
  144. rawr/mcp/trading_tools.py +408 -0
  145. rawr/validators/__init__.py +0 -0
  146. rawr/validators/order_validator.py +49 -0
  147. rawr/version.py +3 -0
  148. rawr_tools-0.1.2.dist-info/METADATA +1843 -0
  149. rawr_tools-0.1.2.dist-info/RECORD +152 -0
  150. rawr_tools-0.1.2.dist-info/WHEEL +4 -0
  151. rawr_tools-0.1.2.dist-info/entry_points.txt +2 -0
  152. rawr_tools-0.1.2.dist-info/licenses/LICENSE +183 -0
rawr/__init__.py ADDED
@@ -0,0 +1,34 @@
1
+ """RAWR: Risk And Win Ratio — AI Quant Trading Tool."""
2
+
3
+ from importlib import import_module
4
+
5
+ from rawr.version import __version__
6
+
7
+ _STAR_IMPORT_EXPORTS = [
8
+ "RawrDB",
9
+ "ApprovalStatus",
10
+ "TradePlan",
11
+ "TradePlanRepository",
12
+ "classify_disclosure",
13
+ "score_sentiment",
14
+ ]
15
+ _OPTIONAL_EXPORTS = [
16
+ "TradePlanService",
17
+ ]
18
+
19
+ __all__ = [
20
+ *_STAR_IMPORT_EXPORTS,
21
+ "__version__",
22
+ ]
23
+
24
+
25
+ def __getattr__(name: str) -> object:
26
+ if name == "__version__":
27
+ return __version__
28
+ if name in _STAR_IMPORT_EXPORTS or name in _OPTIONAL_EXPORTS:
29
+ return getattr(import_module("rawr.api"), name)
30
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
31
+
32
+
33
+ def __dir__() -> list[str]:
34
+ return sorted([*globals(), *__all__])
rawr/api.py ADDED
@@ -0,0 +1,39 @@
1
+ """Supported public Python API for RAWR."""
2
+
3
+ from importlib import import_module
4
+ from typing import Final
5
+
6
+ _EXPORTS: Final[dict[str, tuple[str, str]]] = {
7
+ "RawrDB": ("rawr.core.knowledge.db", "RawrDB"),
8
+ "TradePlanService": ("rawr.core.plans.service", "TradePlanService"),
9
+ "ApprovalStatus": ("rawr.core.plans", "ApprovalStatus"),
10
+ "TradePlan": ("rawr.core.plans", "TradePlan"),
11
+ "TradePlanRepository": ("rawr.core.plans", "TradePlanRepository"),
12
+ "classify_disclosure": ("rawr.core.news", "classify_disclosure"),
13
+ "score_sentiment": ("rawr.core.news", "score_sentiment"),
14
+ }
15
+ _STAR_IMPORT_EXPORTS: Final[tuple[str, ...]] = (
16
+ "RawrDB",
17
+ "ApprovalStatus",
18
+ "TradePlan",
19
+ "TradePlanRepository",
20
+ "classify_disclosure",
21
+ "score_sentiment",
22
+ )
23
+
24
+ __all__ = list(_STAR_IMPORT_EXPORTS)
25
+
26
+
27
+ def __getattr__(name: str) -> object:
28
+ try:
29
+ module_name, attr_name = _EXPORTS[name]
30
+ except KeyError as exc:
31
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from exc
32
+
33
+ value = getattr(import_module(module_name), attr_name)
34
+ globals()[name] = value
35
+ return value
36
+
37
+
38
+ def __dir__() -> list[str]:
39
+ return sorted([*globals(), *__all__])
rawr/cli/__init__.py ADDED
File without changes