Skip to main content

Architecture

The Python library in lib/ handles all mathematical computations. It is intentionally separated from the conversational layer (skills) so that:
  • Every calculation is deterministic — same inputs always produce the same outputs
  • Everything is testable — unit tests validate against Damodaran’s reference spreadsheet
  • No AI in the math — the AI handles conversation; Python handles arithmetic

Core modules

Utility modules

Standalone execution

The plugin can run the full pipeline without any AI interaction via lucky_pipeline.py:
This triggers company identification, data fetching, LTM computation, WACC, growth assumptions, and DCF — all pure Python math. Output is a completed valuation spreadsheet with JSON results.

Testing

All modules are tested against the Almarai example pre-loaded in Damodaran’s fcffsimpleginzu spreadsheet. Additional tests use real NVDA data to verify the SEC EDGAR pipeline end-to-end.
Test coverage includes: WACC computation, DCF projection, curve shapes, LTM bridging, last-10-K extraction, failure rates, lease conversion, option valuation, R&D capitalization, and SEC API fetching.