# daniel-fink/rangekeeper architecture

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

- Interactive diagram: https://gitdiagram.com/daniel-fink/rangekeeper
- Repository: https://github.com/daniel-fink/rangekeeper

## Overview

Rangekeeper is a real-estate financial-modelling library, with a companion Grasshopper integration for creating related model entities from 3D workflows. The principal workflow is to compose financial assumptions and time series into cash flows, then analyse or present model results; the Grasshopper branch creates entities and assembles typed relationships. The README also describes synchronization with 3D design, engineering and logistics models. Some Python modules are indexed but unsampled, so their internal call relationships are omitted; documented capabilities are retained without guessing their wiring.

Main entry points: [`src/rangekeeper/api.py`](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/api.py) (Modelling API), [`grasshopper/Model/Assembly.cs`](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Assembly.cs) (Entity assembly), [`src/rangekeeper/flux.py`](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/flux.py) (Cash flows and streams), [`grasshopper/Model/Entity.cs`](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Entity.cs) (Speckle entity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_finance["Financial modelling"]
  node_api["Modelling API<br/>[api.py]"]
  node_duration["Periods and duration<br/>[duration.py]"]
  node_measure["Measures and units<br/>[measure.py]"]
  node_distribution["Distributions<br/>[distribution.py]"]
  node_dynamics["Market dynamics"]
  node_cyclicality["Market cyclicality<br/>[cyclicality.py]"]
  node_trend["Trends and volatility"]
  node_flux["Cash flows and streams<br/>[flux.py]"]
  node_financial["Financial formulas<br/>[financial.py]"]
  node_projection["Projection<br/>[projection.py]"]
  node_policy["Decision policy<br/>[policy.py]"]
  node_extrapolation["Extrapolation<br/>[extrapolation.py]"]
  node_formula["Financial formula package<br/>[financial.py]"]
end

subgraph group_analysis["Model analysis"]
  node_segmentation["Segmentation<br/>[segmentation.py]"]
  node_graph["Entity graph analysis<br/>[graph.py]"]
  node_format["Model formatting<br/>[format.py]"]
  node_space["Space modelling<br/>[space.py]"]
end

subgraph group_integration["Model integration"]
  node_entity["Speckle entity<br/>[Entity.cs]"]
  node_ientity["Entity contract<br/>[IEntity.cs]"]
  node_relationship["Typed relationship<br/>[Relationship.cs]"]
  node_assembly["Entity assembly<br/>[Assembly.cs]"]
end

subgraph group_gh["Grasshopper authoring"]
  node_create["Create entity<br/>[CreateEntity.cs]"]
  node_addrel["Add relationships"]
  node_assemblyparam["Assembly parameter<br/>[AssemblyParam.cs]"]
  node_ghentity["Entity parameter type<br/>[GH_Entity.cs]"]
end

node_user(("Model author"))
node_ghuser(("Grasshopper modeller"))

node_user -.->|"composes models"| node_api
node_api -->|"exposes"| node_flux
node_api -->|"exposes"| node_projection
node_api -->|"exposes"| node_graph
node_api -->|"exposes"| node_duration
node_api -->|"exposes"| node_measure
node_api -->|"exposes"| node_distribution
node_api -->|"exposes"| node_policy
node_api -->|"exposes"| node_extrapolation
node_api -->|"exposes"| node_segmentation
node_api -->|"exposes"| node_format
node_api -->|"exposes"| node_dynamics
node_api -->|"exposes"| node_formula
node_dynamics -.->|"includes"| node_cyclicality
node_dynamics -.->|"includes"| node_trend
node_flux -->|"uses"| node_measure
node_financial -->|"builds flows"| node_flux
node_financial -->|"uses periods"| node_duration
node_graph -->|"aggregates flows"| node_flux
node_ghuser -.->|"creates entities"| node_create
node_create -->|"creates"| node_entity
node_entity -->|"implements"| node_ientity
node_assembly -->|"stores"| node_relationship
node_assembly -->|"collects"| node_entity
node_relationship -->|"relates"| node_ientity
node_addrel -->|"updates"| node_assembly
node_addrel -.->|"creates"| node_relationship
node_assemblyparam -->|"wraps"| node_assembly
node_ghentity -->|"wraps"| node_entity
node_ghuser -.->|"defines links"| node_addrel
node_ghuser -.->|"synchronizes models"| node_api

click node_api "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/api.py"
click node_duration "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/duration.py"
click node_measure "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/measure.py"
click node_distribution "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/distribution.py"
click node_dynamics "https://github.com/daniel-fink/rangekeeper/tree/main/src/rangekeeper/dynamics"
click node_cyclicality "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/dynamics/cyclicality.py"
click node_trend "https://github.com/daniel-fink/rangekeeper/tree/main/src/rangekeeper/dynamics"
click node_flux "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/flux.py"
click node_financial "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/formula/financial.py"
click node_projection "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/projection.py"
click node_policy "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/policy.py"
click node_extrapolation "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/extrapolation.py"
click node_segmentation "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/segmentation.py"
click node_graph "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/graph.py"
click node_format "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/format.py"
click node_space "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/space.py"
click node_formula "https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/formula/financial.py"
click node_create "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/CreateEntity.cs"
click node_entity "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Entity.cs"
click node_ientity "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/IEntity.cs"
click node_relationship "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Relationship.cs"
click node_assembly "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Assembly.cs"
click node_addrel "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/AddRelationships.cs"
click node_assemblyparam "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/AssemblyParam.cs"
click node_ghentity "https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/GH_Entity.cs"

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_api,node_duration,node_measure,node_distribution,node_dynamics,node_cyclicality,node_trend,node_flux,node_financial,node_projection,node_policy,node_extrapolation,node_formula toneBlue
class node_segmentation,node_graph,node_format,node_space toneAmber
class node_entity,node_ientity,node_relationship,node_assembly toneMint
class node_create,node_addrel,node_assemblyparam,node_ghentity toneRose
class node_user,node_ghuser toneIndigo
```

## Components

### Financial modelling

- [Modelling API](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/api.py): `src/rangekeeper/api.py`
- [Periods and duration](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/duration.py): `src/rangekeeper/duration.py`
- [Measures and units](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/measure.py): `src/rangekeeper/measure.py`
- [Distributions](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/distribution.py): `src/rangekeeper/distribution.py`
- [Market dynamics](https://github.com/daniel-fink/rangekeeper/tree/main/src/rangekeeper/dynamics): `src/rangekeeper/dynamics`
- [Market cyclicality](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/dynamics/cyclicality.py): `src/rangekeeper/dynamics/cyclicality.py`
- [Trends and volatility](https://github.com/daniel-fink/rangekeeper/tree/main/src/rangekeeper/dynamics): `src/rangekeeper/dynamics`
- [Cash flows and streams](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/flux.py): `src/rangekeeper/flux.py`
- [Financial formulas](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/formula/financial.py): `src/rangekeeper/formula/financial.py`
- [Projection](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/projection.py): `src/rangekeeper/projection.py`
- [Decision policy](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/policy.py): `src/rangekeeper/policy.py`
- [Extrapolation](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/extrapolation.py): `src/rangekeeper/extrapolation.py`
- [Financial formula package](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/formula/financial.py): `src/rangekeeper/formula/financial.py`

### Model analysis

- [Segmentation](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/segmentation.py): `src/rangekeeper/segmentation.py`
- [Entity graph analysis](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/graph.py): `src/rangekeeper/graph.py`
- [Model formatting](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/format.py): `src/rangekeeper/format.py`
- [Space modelling](https://github.com/daniel-fink/rangekeeper/blob/main/src/rangekeeper/space.py): `src/rangekeeper/space.py`

### Model integration

- [Speckle entity](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Entity.cs): `grasshopper/Model/Entity.cs`
- [Entity contract](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/IEntity.cs): `grasshopper/Model/IEntity.cs`
- [Typed relationship](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Relationship.cs): `grasshopper/Model/Relationship.cs`
- [Entity assembly](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Model/Assembly.cs): `grasshopper/Model/Assembly.cs`

### Grasshopper authoring

- [Create entity](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/CreateEntity.cs): `grasshopper/Components/CreateEntity.cs`
- [Add relationships](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/AddRelationships.cs): `grasshopper/Components/AddRelationships.cs`
- [Assembly parameter](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/AssemblyParam.cs): `grasshopper/Components/AssemblyParam.cs`
- [Entity parameter type](https://github.com/daniel-fink/rangekeeper/blob/main/grasshopper/Components/GH_Entity.cs): `grasshopper/Components/GH_Entity.cs`

### Other components

- **Model author**
- **Grasshopper modeller**

## Connections

- Model author → Modelling API: composes models
- Modelling API → Cash flows and streams: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Projection: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Entity graph analysis: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Periods and duration: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Measures and units: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Distributions: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Decision policy: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Extrapolation: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Segmentation: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Model formatting: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Market dynamics: exposes (evidence: `src/rangekeeper/__init__.py`)
- Modelling API → Financial formula package: exposes
- Market dynamics → Market cyclicality: includes
- Market dynamics → Trends and volatility: includes
- Cash flows and streams → Measures and units: uses (evidence: `src/rangekeeper/flux.py`)
- Financial formulas → Cash flows and streams: builds flows (evidence: `src/rangekeeper/formula/financial.py`)
- Financial formulas → Periods and duration: uses periods (evidence: `src/rangekeeper/formula/financial.py`)
- Entity graph analysis → Cash flows and streams: aggregates flows (evidence: `src/rangekeeper/graph.py`)
- Grasshopper modeller → Create entity: creates entities
- Create entity → Speckle entity: creates (evidence: `grasshopper/Components/CreateEntity.cs`)
- Speckle entity → Entity contract: implements (evidence: `grasshopper/Model/Entity.cs`)
- Entity assembly → Typed relationship: stores (evidence: `grasshopper/Model/Assembly.cs`)
- Entity assembly → Speckle entity: collects (evidence: `grasshopper/Model/Assembly.cs`)
- Typed relationship → Entity contract: relates (evidence: `grasshopper/Model/Relationship.cs`)
- Add relationships → Entity assembly: updates (evidence: `grasshopper/Components/AddRelationships.cs`)
- Add relationships → Typed relationship: creates (evidence: `grasshopper/Components/AddRelationships.cs`)
- Assembly parameter → Entity assembly: wraps (evidence: `grasshopper/Components/AssemblyParam.cs`)
- Entity parameter type → Speckle entity: wraps (evidence: `grasshopper/Components/GH_Entity.cs`)
- Grasshopper modeller → Add relationships: defines links
- Grasshopper modeller → Modelling API: synchronizes models
