From 372541da2a99f956b067b809b63bf0a5a1d878b5 Mon Sep 17 00:00:00 2001 From: hawkchen Date: Thu, 24 Aug 2023 14:56:14 +0800 Subject: [PATCH] add Backend Calculation Engine --- _data/navigation.yml | 2 ++ dev-ref/Backend_Calculation_Engine.md | 32 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 dev-ref/Backend_Calculation_Engine.md diff --git a/_data/navigation.yml b/_data/navigation.yml index 165890c..109ba1d 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -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 diff --git a/dev-ref/Backend_Calculation_Engine.md b/dev-ref/Backend_Calculation_Engine.md new file mode 100644 index 0000000..55318c5 --- /dev/null +++ b/dev-ref/Backend_Calculation_Engine.md @@ -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. \ No newline at end of file