How polestardhruvtiwari/denave works
This CLI extracts structured financials, risks, and business segments from SEC 10-K filings or local PDFs, then validates and saves a quality-scored JSON result. The graph follows the documented LangGraph stages; the source excerpt omits some workflow wiring, so those transitions rely on the README architecture. Detailed PDF-fetch and section-splitting implementations are not shown in the sampled source.
Main entry points: extractor.py LangGraph workflow · main.py CLI entry
Components 15
CLI and orchestration
- CLI entry
main.py - Financial extractor
extractor.py
Document acquisition
- Document fetcher
extractor.py - Section identifier
extractor.py
Extraction workflow
- LangGraph workflow
extractor.py - Extract financials
extractor.py - Validate data
extractor.py - Extract risks
extractor.py - Extract segments
extractor.py - Quality check
extractor.py
Results
- Result JSON
extractor.py
Other components
- User
- SEC EDGAR
- OpenAI LLM
- Output files
Connections 19
- User → CLI entry: provides ticker/PDF
- CLI entry → Financial extractor: runs extraction
- Financial extractor → Document fetcher: fetches document
- Document fetcher → SEC EDGAR: downloads filing
- Document fetcher → Section identifier: returns text
- Financial extractor → Section identifier: splits sections
- Financial extractor → LangGraph workflow: invokes workflow
- LangGraph workflow → Extract financials: dispatches
- Extract financials → OpenAI LLM: requests extraction
- LangGraph workflow → Validate data: dispatches
- Validate data → Extract financials: retries on failure
- LangGraph workflow → Extract risks: continues
- Extract risks → OpenAI LLM: requests extraction
- LangGraph workflow → Extract segments: continues
- Extract segments → OpenAI LLM: requests extraction
- LangGraph workflow → Quality check: continues
- LangGraph workflow → Result JSON: returns final state
- Financial extractor → Output files: writes JSON
- Result JSON → CLI entry: returns result