Skip to content

Commit

Permalink
add Backend Calculation Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkchen committed Aug 24, 2023
1 parent 801cf5e commit 372541d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ dev-ref:
children:
- title: User Permission
url: /dev-ref/User_Permission
- title: Backend Calculation Engine
url: /dev-ref/Backend_Calculation_Engine
- title: More Use Cases
url: https://keikai.io/blog/category/usecase/
- title: FAQ
Expand Down
32 changes: 32 additions & 0 deletions dev-ref/Backend_Calculation_Engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: 'Backend Calculation Engine'
---

# Overview
Keikai provides the capability to use spreadsheets in a non-UI, headless fashion, like an automated backend calculation engine.

The key component is the [Book Model](/dev-ref/book_model/Manipulating_Book_Model), which stores all cell data and formulas. You can directly access and manipulate this model programmatically, without needing to render a visual spreadsheet in a browser.

This enables loading data into a Book Model from any source (e.g. databases), executing calculations with formulas, and reading back results, all without any UI.

Data ----> Book Model ----> Result

With this kind of usage, keikai can be a backend calculation engine or perform a automating operation.

## Benefits
Using Keikai as a backend calculation engine provides these benefits:

* No UI required - Automate spreadsheet workflows without rendering a visual interface.
* Update calculations via formulas - Formula logic can be modified without code changes, lowering maintenance effort.
* Leverage spreadsheet calculation power - Harness the calculation capabilities of spreadsheets for backend data processing.

# Steps
The general steps to use Keikai in headless way are:
1. [Import an XLSX file](/dev-ref/import) to instantiate a Book model.
The file may contain predefined formulas.
2. [Load input data](/dev-ref/book_model/Manipulating_Book_Model) into the model with `Range` API.
Recommend to use named range instead of cell address for readability and stability.
3. Retrieve calculation output by reading cell values using the `Range` API.


By eliminating UI concerns, Keikai can serve as a powerful calculation engine for server-side automation processes. The XLSX format provides a portable way to apply spreadsheet logic across many use cases.

0 comments on commit 372541d

Please sign in to comment.