# patroii/hotxlfp architecture

> Architecture diagram of the GitHub repository patroii/hotxlfp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/patroii/hotxlfp
- Repository: https://github.com/patroii/hotxlfp

## Overview

hotxlfp is a Python Excel-formula parser and evaluator. A caller creates a Parser, submits a formula string, and receives a result/error pair. The parser tokenizes and parses expressions, delegates formula calls and variable/cell lookups to the Parser API, and evaluates operators or registered built-in functions. The graph preserves the documented formula families and custom-function/variable support. Connections among unsampled modules are limited to relationships named in the SOURCE INDEX; it does not show a backing spreadsheet or persistence layer.

Main entry points: [`hotxlfp/formulas/__init__.py`](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/__init__.py) (Function registry), [`hotxlfp/formulas/utils.py`](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/utils.py) (Formula utilities), [`hotxlfp/parser.py`](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/parser.py) (Parser API), [`hotxlfp/grammarparser/parser.py`](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/grammarparser/parser.py) (Formula grammar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Parser API"]
  node_parser_api["Parser API<br/>[parser.py]"]
  node_emitter["Event emitter<br/>[tinyemitter.py]"]
end

subgraph group_syntax["Formula syntax"]
  node_lexer["Formula lexer<br/>[lexer.py]"]
  node_grammar["Formula grammar<br/>[parser.py]"]
end

subgraph group_runtime["Evaluation runtime"]
  node_dispatcher["Function registry<br/>[__init__.py]"]
  node_formula_utils["Formula utilities<br/>[utils.py]"]
  node_formula_errors["Formula errors<br/>[error.py]"]
  node_operators["Operators<br/>[operators.py]"]
  node_date_time["Date and time<br/>[dateandtime.py]"]
  node_engineering["Engineering<br/>[engineering.py]"]
  node_financial["Financial<br/>[financial.py]"]
  node_information["Information<br/>[information.py]"]
  node_logic["Logic<br/>[logic.py]"]
  node_lookup["Lookup and reference"]
  node_math_trig["Math and trigonometry<br/>[mathtrig.py]"]
  node_statistical["Statistical<br/>[statistical.py]"]
  node_text["Text<br/>[text.py]"]
end

subgraph group_support["Runtime support"]
  node_cell["Cell coordinates<br/>[cell.py]"]
  node_number["Number conversion<br/>[number.py]"]
  node_compat["Compatibility layer<br/>[__init__.py]"]
  node_statistics_compat["Statistics fallback<br/>[statistics.py]"]
end

node_user(("Formula caller"))

node_user -->|"submits formula"| node_parser_api
node_parser_api -->|"parses with"| node_grammar
node_parser_api -->|"resolves built-ins"| node_dispatcher
node_parser_api -->|"emits events"| node_emitter
node_parser_api -->|"builds cell lookups"| node_cell
node_grammar -->|"tokenizes with"| node_lexer
node_grammar -->|"evaluates operators"| node_operators
node_grammar -->|"converts numbers"| node_number
node_dispatcher -->|"registers functions"| node_date_time
node_dispatcher -->|"registers functions"| node_engineering
node_dispatcher -->|"registers functions"| node_financial
node_dispatcher -->|"registers functions"| node_information
node_dispatcher -->|"registers functions"| node_logic
node_dispatcher -->|"registers functions"| node_lookup
node_dispatcher -->|"registers functions"| node_math_trig
node_dispatcher -->|"registers functions"| node_statistical
node_dispatcher -->|"registers functions"| node_text
node_date_time -->|"uses utilities"| node_formula_utils
node_engineering -->|"uses utilities"| node_formula_utils
node_financial -->|"uses utilities"| node_formula_utils
node_information -->|"uses utilities"| node_formula_utils
node_logic -->|"uses utilities"| node_formula_utils
node_lookup -->|"uses utilities"| node_formula_utils
node_math_trig -->|"uses utilities"| node_formula_utils
node_statistical -->|"uses utilities"| node_formula_utils
node_text -->|"uses utilities"| node_formula_utils
node_operators -->|"uses date utilities"| node_formula_utils
node_formula_utils -->|"converts values"| node_number
node_operators -->|"converts operands"| node_number
node_statistics_compat -->|"selected for Python 2"| node_compat

click node_parser_api "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/parser.py"
click node_emitter "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/tinyemitter.py"
click node_lexer "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/grammarparser/lexer.py"
click node_grammar "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/grammarparser/parser.py"
click node_cell "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/helper/cell.py"
click node_number "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/helper/number.py"
click node_compat "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/_compat/__init__.py"
click node_statistics_compat "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/_compat/py3/statistics.py"
click node_dispatcher "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/__init__.py"
click node_formula_utils "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/utils.py"
click node_formula_errors "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/error.py"
click node_operators "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/operators.py"
click node_date_time "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/dateandtime.py"
click node_engineering "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/engineering.py"
click node_financial "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/financial.py"
click node_information "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/information.py"
click node_logic "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/logic.py"
click node_lookup "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/lookupandreference.py"
click node_math_trig "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/mathtrig.py"
click node_statistical "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/statistical.py"
click node_text "https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/text.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_parser_api,node_emitter toneBlue
class node_lexer,node_grammar toneAmber
class node_dispatcher,node_formula_utils,node_formula_errors,node_operators,node_date_time,node_engineering,node_financial,node_information,node_logic,node_lookup,node_math_trig,node_statistical,node_text toneMint
class node_cell,node_number,node_compat,node_statistics_compat toneRose
class node_user toneIndigo
```

## Components

### Parser API

- [Parser API](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/parser.py): `hotxlfp/parser.py`
- [Event emitter](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/tinyemitter.py): `hotxlfp/tinyemitter.py`

### Formula syntax

- [Formula lexer](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/grammarparser/lexer.py): `hotxlfp/grammarparser/lexer.py`
- [Formula grammar](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/grammarparser/parser.py): `hotxlfp/grammarparser/parser.py`

### Evaluation runtime

- [Function registry](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/__init__.py): `hotxlfp/formulas/__init__.py`
- [Formula utilities](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/utils.py): `hotxlfp/formulas/utils.py`
- [Formula errors](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/error.py): `hotxlfp/formulas/error.py`
- [Operators](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/operators.py): `hotxlfp/formulas/operators.py`
- [Date and time](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/dateandtime.py): `hotxlfp/formulas/dateandtime.py`
- [Engineering](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/engineering.py): `hotxlfp/formulas/engineering.py`
- [Financial](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/financial.py): `hotxlfp/formulas/financial.py`
- [Information](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/information.py): `hotxlfp/formulas/information.py`
- [Logic](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/logic.py): `hotxlfp/formulas/logic.py`
- [Lookup and reference](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/lookupandreference.py): `hotxlfp/formulas/lookupandreference.py`
- [Math and trigonometry](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/mathtrig.py): `hotxlfp/formulas/mathtrig.py`
- [Statistical](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/statistical.py): `hotxlfp/formulas/statistical.py`
- [Text](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/formulas/text.py): `hotxlfp/formulas/text.py`

### Runtime support

- [Cell coordinates](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/helper/cell.py): `hotxlfp/helper/cell.py`
- [Number conversion](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/helper/number.py): `hotxlfp/helper/number.py`
- [Compatibility layer](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/_compat/__init__.py): `hotxlfp/_compat/__init__.py`
- [Statistics fallback](https://github.com/patroii/hotxlfp/blob/master/hotxlfp/_compat/py3/statistics.py): `hotxlfp/_compat/py3/statistics.py`

### Other components

- **Formula caller**

## Connections

- Formula caller → Parser API: submits formula (evidence: `README.md`)
- Parser API → Formula grammar: parses with (evidence: `hotxlfp/parser.py`)
- Parser API → Function registry: resolves built-ins (evidence: `hotxlfp/parser.py`)
- Parser API → Event emitter: emits events (evidence: `hotxlfp/parser.py`)
- Parser API → Cell coordinates: builds cell lookups (evidence: `hotxlfp/parser.py`)
- Formula grammar → Formula lexer: tokenizes with (evidence: `hotxlfp/grammarparser/parser.py`)
- Formula grammar → Operators: evaluates operators (evidence: `hotxlfp/grammarparser/parser.py`)
- Formula grammar → Number conversion: converts numbers (evidence: `hotxlfp/grammarparser/parser.py`)
- Function registry → Date and time: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Engineering: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Financial: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Information: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Logic: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Lookup and reference: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Math and trigonometry: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Statistical: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Function registry → Text: registers functions (evidence: `hotxlfp/formulas/__init__.py`)
- Date and time → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/dateandtime.py`)
- Engineering → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/engineering.py`)
- Financial → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/financial.py`)
- Information → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/information.py`)
- Logic → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/logic.py`)
- Lookup and reference → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/lookupandreference.py`)
- Math and trigonometry → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/mathtrig.py`)
- Statistical → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/statistical.py`)
- Text → Formula utilities: uses utilities (evidence: `hotxlfp/formulas/text.py`)
- Operators → Formula utilities: uses date utilities (evidence: `hotxlfp/formulas/operators.py`)
- Formula utilities → Number conversion: converts values (evidence: `hotxlfp/formulas/utils.py`)
- Operators → Number conversion: converts operands (evidence: `hotxlfp/formulas/operators.py`)
- Statistics fallback → Compatibility layer: selected for Python 2 (evidence: `hotxlfp/_compat/__init__.py`)
