f8-engine 0.5.0__tar.gz → 0.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. {f8_engine-0.5.0 → f8_engine-0.5.1}/Cargo.lock +119 -2
  2. {f8_engine-0.5.0 → f8_engine-0.5.1}/Cargo.toml +4 -2
  3. {f8_engine-0.5.0 → f8_engine-0.5.1}/PKG-INFO +66 -13
  4. {f8_engine-0.5.0 → f8_engine-0.5.1}/README.md +65 -12
  5. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/compiled/mod.rs +14 -0
  6. f8_engine-0.5.1/crates/f8-core/src/compiler/error.rs +332 -0
  7. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/mod.rs +2 -2
  8. f8_engine-0.5.1/crates/f8-python/src/error.rs +195 -0
  9. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-python/src/model.rs +1 -12
  10. f8_engine-0.5.0/crates/f8-core/src/compiler/error.rs +0 -49
  11. f8_engine-0.5.0/crates/f8-python/src/error.rs +0 -349
  12. {f8_engine-0.5.0 → f8_engine-0.5.1}/LICENSE +0 -0
  13. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/Cargo.toml +0 -0
  14. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/compiled/error.rs +0 -0
  15. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/compiled/model.rs +0 -0
  16. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/emission/error.rs +0 -0
  17. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/emission/format.rs +0 -0
  18. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/emission/mod.rs +0 -0
  19. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/emission/workbook.rs +0 -0
  20. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/eval/context.rs +0 -0
  21. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/eval/error.rs +0 -0
  22. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/eval/expr.rs +0 -0
  23. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/eval/mod.rs +0 -0
  24. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/eval/model.rs +0 -0
  25. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/graph/cycle.rs +0 -0
  26. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/graph/dependency.rs +0 -0
  27. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/graph/error.rs +0 -0
  28. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/graph/mod.rs +0 -0
  29. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/graph/resolve.rs +0 -0
  30. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/ir/cell.rs +0 -0
  31. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/ir/error.rs +0 -0
  32. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/ir/expand.rs +0 -0
  33. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/ir/id.rs +0 -0
  34. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/ir/mod.rs +0 -0
  35. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/ir/symbol.rs +0 -0
  36. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/layout/a1.rs +0 -0
  37. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/layout/error.rs +0 -0
  38. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/layout/mod.rs +0 -0
  39. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/lowering/address.rs +0 -0
  40. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/lowering/error.rs +0 -0
  41. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/compiler/lowering/mod.rs +0 -0
  42. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/expr/ast.rs +0 -0
  43. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/expr/error.rs +0 -0
  44. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/expr/mod.rs +0 -0
  45. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/expr/parser.rs +0 -0
  46. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/common.rs +0 -0
  47. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/date/constructors.rs +0 -0
  48. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/date/mod.rs +0 -0
  49. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/date/parts.rs +0 -0
  50. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/date/serial.rs +0 -0
  51. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/date/yearfrac.rs +0 -0
  52. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/error.rs +0 -0
  53. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/financial/annuity.rs +0 -0
  54. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/financial/discounting.rs +0 -0
  55. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/financial/irr.rs +0 -0
  56. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/financial/mod.rs +0 -0
  57. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/logical/boolean.rs +0 -0
  58. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/logical/branching.rs +0 -0
  59. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/logical/error_handling.rs +0 -0
  60. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/logical/mod.rs +0 -0
  61. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/lookup/index.rs +0 -0
  62. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/lookup/mod.rs +0 -0
  63. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/lookup/search.rs +0 -0
  64. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/lookup/xlookup.rs +0 -0
  65. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/lookup/xmatch.rs +0 -0
  66. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/math/aggregation.rs +0 -0
  67. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/math/basic.rs +0 -0
  68. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/math/conditional.rs +0 -0
  69. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/math/criteria.rs +0 -0
  70. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/math/mod.rs +0 -0
  71. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/math/product.rs +0 -0
  72. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/math/rounding.rs +0 -0
  73. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/mod.rs +0 -0
  74. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/registry.rs +0 -0
  75. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/functions/traits.rs +0 -0
  76. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/lib.rs +0 -0
  77. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/model/error.rs +0 -0
  78. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/model/format.rs +0 -0
  79. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/model/id.rs +0 -0
  80. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/model/manifest.rs +0 -0
  81. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/model/mod.rs +0 -0
  82. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/model/table.rs +0 -0
  83. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/model/theme.rs +0 -0
  84. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/value/error.rs +0 -0
  85. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/value/format.rs +0 -0
  86. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-core/src/value/mod.rs +0 -0
  87. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-python/Cargo.toml +0 -0
  88. {f8_engine-0.5.0 → f8_engine-0.5.1}/crates/f8-python/src/lib.rs +0 -0
  89. {f8_engine-0.5.0 → f8_engine-0.5.1}/pyproject.toml +0 -0
  90. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/__init__.py +0 -0
  91. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/__main__.py +0 -0
  92. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/_core.pyi +0 -0
  93. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/audit.py +0 -0
  94. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/builder.py +0 -0
  95. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/cli.py +0 -0
  96. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/py.typed +0 -0
  97. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/skills/f8-modeling/SKILL.md +0 -0
  98. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/skills/f8-modeling/references/auditing-and-repair.md +0 -0
  99. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/skills/f8-modeling/references/functions.md +0 -0
  100. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/skills/f8-modeling/references/syntax-and-grid.md +0 -0
  101. {f8_engine-0.5.0 → f8_engine-0.5.1}/python/f8/types.py +0 -0
@@ -37,7 +37,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
37
37
 
38
38
  [[package]]
39
39
  name = "f8-core"
40
- version = "0.5.0"
40
+ version = "0.5.1"
41
41
  dependencies = [
42
42
  "indexmap",
43
43
  "petgraph",
@@ -50,13 +50,25 @@ dependencies = [
50
50
 
51
51
  [[package]]
52
52
  name = "f8-python"
53
- version = "0.5.0"
53
+ version = "0.5.1"
54
54
  dependencies = [
55
55
  "f8-core",
56
56
  "pyo3",
57
57
  "pythonize",
58
58
  ]
59
59
 
60
+ [[package]]
61
+ name = "f8-wasm"
62
+ version = "0.5.1"
63
+ dependencies = [
64
+ "f8-core",
65
+ "rust_xlsxwriter",
66
+ "serde",
67
+ "serde-wasm-bindgen",
68
+ "serde_json",
69
+ "wasm-bindgen",
70
+ ]
71
+
60
72
  [[package]]
61
73
  name = "fixedbitset"
62
74
  version = "0.5.7"
@@ -78,6 +90,30 @@ version = "0.1.5"
78
90
  source = "registry+https://github.com/rust-lang/crates.io-index"
79
91
  checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
80
92
 
93
+ [[package]]
94
+ name = "futures-core"
95
+ version = "0.3.34"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+ checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
98
+
99
+ [[package]]
100
+ name = "futures-task"
101
+ version = "0.3.34"
102
+ source = "registry+https://github.com/rust-lang/crates.io-index"
103
+ checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
104
+
105
+ [[package]]
106
+ name = "futures-util"
107
+ version = "0.3.34"
108
+ source = "registry+https://github.com/rust-lang/crates.io-index"
109
+ checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
110
+ dependencies = [
111
+ "futures-core",
112
+ "futures-task",
113
+ "pin-project-lite",
114
+ "slab",
115
+ ]
116
+
81
117
  [[package]]
82
118
  name = "hashbrown"
83
119
  version = "0.15.5"
@@ -126,6 +162,17 @@ version = "1.0.18"
126
162
  source = "registry+https://github.com/rust-lang/crates.io-index"
127
163
  checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
128
164
 
165
+ [[package]]
166
+ name = "js-sys"
167
+ version = "0.3.107"
168
+ source = "registry+https://github.com/rust-lang/crates.io-index"
169
+ checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"
170
+ dependencies = [
171
+ "cfg-if",
172
+ "futures-util",
173
+ "wasm-bindgen",
174
+ ]
175
+
129
176
  [[package]]
130
177
  name = "libc"
131
178
  version = "0.2.189"
@@ -171,6 +218,12 @@ dependencies = [
171
218
  "serde",
172
219
  ]
173
220
 
221
+ [[package]]
222
+ name = "pin-project-lite"
223
+ version = "0.2.17"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
226
+
174
227
  [[package]]
175
228
  name = "portable-atomic"
176
229
  version = "1.15.0"
@@ -274,6 +327,8 @@ version = "0.99.1"
274
327
  source = "registry+https://github.com/rust-lang/crates.io-index"
275
328
  checksum = "34f2d2cda7223168a14fb86bc7411dbc3379bd7d49749ecc53b91ed98585b6b0"
276
329
  dependencies = [
330
+ "js-sys",
331
+ "wasm-bindgen",
277
332
  "zip",
278
333
  ]
279
334
 
@@ -293,6 +348,17 @@ dependencies = [
293
348
  "serde_derive",
294
349
  ]
295
350
 
351
+ [[package]]
352
+ name = "serde-wasm-bindgen"
353
+ version = "0.6.5"
354
+ source = "registry+https://github.com/rust-lang/crates.io-index"
355
+ checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b"
356
+ dependencies = [
357
+ "js-sys",
358
+ "serde",
359
+ "wasm-bindgen",
360
+ ]
361
+
296
362
  [[package]]
297
363
  name = "serde_core"
298
364
  version = "1.0.229"
@@ -319,6 +385,7 @@ version = "1.0.151"
319
385
  source = "registry+https://github.com/rust-lang/crates.io-index"
320
386
  checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
321
387
  dependencies = [
388
+ "indexmap",
322
389
  "itoa",
323
390
  "memchr",
324
391
  "serde",
@@ -332,6 +399,12 @@ version = "0.3.10"
332
399
  source = "registry+https://github.com/rust-lang/crates.io-index"
333
400
  checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
334
401
 
402
+ [[package]]
403
+ name = "slab"
404
+ version = "0.4.12"
405
+ source = "registry+https://github.com/rust-lang/crates.io-index"
406
+ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
407
+
335
408
  [[package]]
336
409
  name = "syn"
337
410
  version = "2.0.119"
@@ -398,6 +471,50 @@ version = "0.2.4"
398
471
  source = "registry+https://github.com/rust-lang/crates.io-index"
399
472
  checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
400
473
 
474
+ [[package]]
475
+ name = "wasm-bindgen"
476
+ version = "0.2.130"
477
+ source = "registry+https://github.com/rust-lang/crates.io-index"
478
+ checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c"
479
+ dependencies = [
480
+ "cfg-if",
481
+ "rustversion",
482
+ "wasm-bindgen-macro",
483
+ "wasm-bindgen-shared",
484
+ ]
485
+
486
+ [[package]]
487
+ name = "wasm-bindgen-macro"
488
+ version = "0.2.130"
489
+ source = "registry+https://github.com/rust-lang/crates.io-index"
490
+ checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9"
491
+ dependencies = [
492
+ "quote",
493
+ "wasm-bindgen-macro-support",
494
+ ]
495
+
496
+ [[package]]
497
+ name = "wasm-bindgen-macro-support"
498
+ version = "0.2.130"
499
+ source = "registry+https://github.com/rust-lang/crates.io-index"
500
+ checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a"
501
+ dependencies = [
502
+ "bumpalo",
503
+ "proc-macro2",
504
+ "quote",
505
+ "syn 3.0.5",
506
+ "wasm-bindgen-shared",
507
+ ]
508
+
509
+ [[package]]
510
+ name = "wasm-bindgen-shared"
511
+ version = "0.2.130"
512
+ source = "registry+https://github.com/rust-lang/crates.io-index"
513
+ checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e"
514
+ dependencies = [
515
+ "unicode-ident",
516
+ ]
517
+
401
518
  [[package]]
402
519
  name = "zip"
403
520
  version = "8.6.0"
@@ -3,7 +3,7 @@ resolver = "3"
3
3
  members = ["crates/f8-core", "crates/f8-python"]
4
4
 
5
5
  [workspace.package]
6
- version = "0.5.0"
6
+ version = "0.5.1"
7
7
  edition = "2024"
8
8
  description = "Financial modeling engine with compiler verification and live Excel formulas"
9
9
  authors = ["Michael (Chencheng) Hu, CFA"]
@@ -15,12 +15,14 @@ f8-core = { path = "crates/f8-core" }
15
15
  indexmap = { version = "2.7", features = ["serde"] }
16
16
  petgraph = "0.8.3"
17
17
  serde = { version = "1.0", features = ["derive"] }
18
- serde_json = "1.0"
18
+ serde_json = { version = "1.0", features = ["preserve_order"] }
19
19
  rust_xlsxwriter = "0.99"
20
20
  thiserror = "2.0"
21
21
  zip = { version = "8.6", default-features = false }
22
22
  pyo3 = { version = "0.24", default-features = false, features = ["macros"] }
23
23
  pythonize = "0.24"
24
+ wasm-bindgen = "0.2"
25
+ serde-wasm-bindgen = "0.6"
24
26
 
25
27
  [workspace.lints.clippy]
26
28
  unwrap_used = "deny"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: f8-engine
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Intended Audience :: Financial and Insurance Industry
@@ -31,7 +31,7 @@ Author, verify, and automate financial models with code and AI agents, compiled
31
31
  ## Who is f8 for
32
32
 
33
33
  1. **People who want AI to reliably build complex Excel models (financial and beyond)**: Give AI agents a semantic 2D DSL and compile-time verification to produce clean and error-free `.xlsx` workbooks with live formulas.
34
- 2. **People doing financial analysis in pure code (no Excel required)**: Run row-by-row financial statements, corkscrew schedules, and cross-table dependency graphs in Python (where columnar DataFrames fall short), with `compiled.save("model.xlsx")` ready whenever a stakeholder asks for the spreadsheet.
34
+ 2. **People doing financial analysis in pure code (no Excel required)**: Run row-by-row financial statements, corkscrew schedules, and cross-table dependency graphs in Python or TypeScript (where columnar DataFrames fall short), with `compiled.save("model.xlsx")` ready whenever a stakeholder asks for the spreadsheet.
35
35
 
36
36
  ## Why f8
37
37
 
@@ -46,11 +46,13 @@ AI agents struggle to manipulate raw spreadsheets (`openpyxl`, Office.js, or GUI
46
46
 
47
47
  - Semantic 2D modeling: Author models with readable table, row, and column identifiers; `f8` handles spatial layout and lowers logic into native Excel formulas.
48
48
  - Compiler-enforced rigor: A 6-pass Rust compiler verifies grid completeness (zero unassigned cells or formula overlaps) and enforces a strict DAG via Tarjan cycle detection.
49
- - Closed-loop verification: Evaluates formulas in memory so AI agents and `pytest` suites can audit tables, trace dependencies, and verify accounting checks in milliseconds, without opening Excel.
49
+ - Closed-loop verification: Evaluates formulas in memory so AI agents and test suites (`pytest`, `vitest`) can audit tables, trace dependencies, and verify accounting checks in milliseconds, without opening Excel.
50
50
  - Verified Excel parity: Matches Excel on all 44 supported functions, including error propagation, type coercion, and the 1900 leap day bug. The [parity workbook](https://github.com/mhcfa/f8/releases/latest/download/excel_parity_verification.xlsx) ships without cached values, so Excel itself recalculates and grades 101 cases on open: exact match for integers, text, dates, and lookups; 1e-9 relative tolerance for floating-point and iterative functions (`IRR`, `XIRR`); exact error type for 23 error cases.
51
51
 
52
52
  ## Getting started
53
53
 
54
+ ### Python
55
+
54
56
  Install from PyPI (package name is `f8-engine`, imported as `f8`):
55
57
 
56
58
  ```bash
@@ -59,6 +61,16 @@ pip install f8-engine
59
61
  uv add f8-engine
60
62
  ```
61
63
 
64
+ ### TypeScript / JavaScript
65
+
66
+ Install from npm (package name is `f8-engine`):
67
+
68
+ ```bash
69
+ npm install f8-engine
70
+ # or
71
+ pnpm add f8-engine
72
+ ```
73
+
62
74
  If you are working with an AI coding agent, `f8` ships with a bundled modeling skill and CLI reference you can drop straight into your workspace:
63
75
 
64
76
  ```bash
@@ -69,6 +81,8 @@ f8 guide --all # streams the full DSL, function, and auditing guide to stdout
69
81
 
70
82
  ## Quick look
71
83
 
84
+ ### Python
85
+
72
86
  ```python
73
87
  from f8 import Model
74
88
 
@@ -107,6 +121,45 @@ print(compiled.table("PPE").to_markdown())
107
121
  compiled.save("forecast.xlsx")
108
122
  ```
109
123
 
124
+ ### TypeScript
125
+
126
+ ```typescript
127
+ import { Model } from "f8-engine";
128
+
129
+ const years = ["2025A", "2026E", "2027E"] as const;
130
+ const capex = { "2025A": 25.0, "2026E": 30.0, "2027E": 35.0 };
131
+ const depr = { "2025A": -15.0, "2026E": -18.0, "2027E": -22.0 };
132
+
133
+ const model = new Model({ name: "Operating Forecast" });
134
+ const sheet = model.addSheet("Summary");
135
+
136
+ const ppe = sheet.addTable("PPE", "PP&E Corkscrew Schedule", { subtitle: "($ in millions)" });
137
+ ppe.addColumn("item", { role: "descriptor", header: "Line Item" });
138
+ for (const year of years) {
139
+ ppe.addColumn(year, { header: year, format: "currency", decimals: 1 });
140
+ }
141
+
142
+ ppe.addRow("beg_balance", {
143
+ cells: { item: "Beginning Balance", "2025A": 100.0 },
144
+ expr: 'PPE["end_balance", col.prev]',
145
+ });
146
+ ppe.addRow("capex", { cells: { item: "Capital Expenditures", ...capex } });
147
+ ppe.addRow("depreciation", { cells: { item: "Depreciation", ...depr } });
148
+ ppe.addRow("end_balance", {
149
+ cells: { item: "Ending Balance" },
150
+ expr: 'SUM(PPE["beg_balance".."depreciation", @col])',
151
+ style: "total",
152
+ });
153
+
154
+ const compiled = model.compile();
155
+
156
+ // Audit evaluated values in memory (or pass { view: "formulas" } to inspect lowered Excel formulas)
157
+ console.log(compiled.table("PPE").toMarkdown());
158
+
159
+ // Emit a live .xlsx workbook with native Excel formulas and styling (you don't have to)
160
+ compiled.save("forecast.xlsx");
161
+ ```
162
+
110
163
  Output:
111
164
 
112
165
  ```markdown
@@ -123,12 +176,11 @@ Output:
123
176
  Inspect compiled deliverables generated from real-world models:
124
177
 
125
178
  - [costco_financial_model.xlsx](https://github.com/mhcfa/f8/releases/latest/download/costco_financial_model.xlsx): Compiled financial model with live Excel formulas.
126
- - [costco_valuation_report.pdf](https://github.com/mhcfa/f8/releases/latest/download/costco_valuation_report.pdf): Valuation report rendered directly from the compiled `f8` model using Quarto, Typst, and Matplotlib.
127
179
  - [lbo_model.xlsx](https://github.com/mhcfa/f8/releases/latest/download/lbo_model.xlsx): Multi-sheet leveraged buyout (LBO) model with transaction structuring, debt waterfall, and returns analysis.
128
180
 
129
181
  ### LBO model demo
130
182
 
131
- Complete model repo: https://github.com/mhcfa/f8-demo
183
+ Complete model repo: https://github.com/mhcfa/f8-demo (this one is written in Python)
132
184
 
133
185
  ![LBO Executive Dashboard](https://github.com/mhcfa/f8/releases/latest/download/lbo-dashboard.png)
134
186
 
@@ -148,25 +200,26 @@ Complete model repo: https://github.com/mhcfa/f8-demo
148
200
  | Superior AI modeling | Being an Excel Ninja |
149
201
  | Readable semantic code and logic | The joy of hunting down a hidden `#REF!` at 2 AM |
150
202
 
151
- Jokes aside, writing models in code gives you 40 years of software infrastructure out of the box, line-by-line `git diff` reviews, automated `pytest` checks, reusable modules, and parametric loops. The only real downsides I can think of are:
203
+ Jokes aside, writing models in code gives you 40 years of software infrastructure out of the box, line-by-line `git diff` reviews, automated `pytest` and `vitest` checks, reusable modules, and parametric loops. The only real downsides I can think of are:
152
204
 
153
205
  1. You can't do whatever you want when it comes to layout in the emitted workbook; everything has to be structured. But you wouldn't want your spreadsheet to be a mess anyway, right?
154
- 2. You have to learn some Python. But that is largely solved by AI now.
155
- 3. Constantly re-compiling just to peek at the Excel workbook can be a bit annoying, so we provide in-memory inspection methods in Python. Once you get used to `print()`, you don't need to open the `.xlsx` all the time (or just ask AI to do it).
206
+ 2. You have to learn some Python or TypeScript. But that is largely solved by AI now.
207
+ 3. Constantly re-compiling just to peek at the Excel workbook can be a bit annoying, so we provide in-memory inspection methods in both SDKs. Once you get used to printing tables in the terminal, you don't need to open the `.xlsx` all the time (or just ask AI to do it).
156
208
  4. There are no circular references or iterative solvers (as per FAST Standard Section 2.01). There is a closed-form formula that solves the revolver circularity problem without circular references anyway (and don't worry, AI knows it).
157
- 5. There is no native Excel chart emission yet (on roadmap), and no Pivot Tables. But since you are already in Python, `pandas` or `polars` handles data aggregation much better.
209
+ 5. There is no native Excel chart emission yet (on roadmap), and no Pivot Tables. But since you are already in code, your language ecosystem handles data aggregation much better.
158
210
 
159
211
  ## Architecture
160
212
 
161
- Under the hood, `f8` is a Python SDK (`python/f8/`) backed by a 6-pass Rust compiler (`crates/f8-core/`):
213
+ Under the hood, `f8` provides Python (`python/f8/`) and TypeScript/WebAssembly (`ts/`, `crates/f8-wasm/`) SDKs backed by a 6-pass Rust compiler (`crates/f8-core/`):
162
214
 
163
215
  `Spec -> IR Expansion -> DAG & Cycle Check -> Topological Evaluation -> Spatial Layout -> Formula Lowering -> .xlsx Emission`
164
216
 
165
217
  - Architecture overview: `docs/architecture.md`
166
218
  - Python modeling skill: `python/f8/skills/f8-modeling/SKILL.md`
167
- - Syntax, grid, and formatting reference: `python/f8/skills/f8-modeling/references/syntax-and-grid.md`
168
- - Function reference: `python/f8/skills/f8-modeling/references/functions.md`
169
- - Auditing and repair reference: `python/f8/skills/f8-modeling/references/auditing-and-repair.md`
219
+ - TypeScript modeling skill: `ts/skills/f8-modeling/SKILL.md`
220
+ - Syntax, grid, and formatting reference: `python/f8/skills/f8-modeling/references/syntax-and-grid.md` / `ts/skills/f8-modeling/references/syntax-and-grid.md`
221
+ - Function reference: `python/f8/skills/f8-modeling/references/functions.md` / `ts/skills/f8-modeling/references/functions.md`
222
+ - Auditing and repair reference: `python/f8/skills/f8-modeling/references/auditing-and-repair.md` / `ts/skills/f8-modeling/references/auditing-and-repair.md`
170
223
 
171
224
  ## License
172
225
 
@@ -5,7 +5,7 @@ Author, verify, and automate financial models with code and AI agents, compiled
5
5
  ## Who is f8 for
6
6
 
7
7
  1. **People who want AI to reliably build complex Excel models (financial and beyond)**: Give AI agents a semantic 2D DSL and compile-time verification to produce clean and error-free `.xlsx` workbooks with live formulas.
8
- 2. **People doing financial analysis in pure code (no Excel required)**: Run row-by-row financial statements, corkscrew schedules, and cross-table dependency graphs in Python (where columnar DataFrames fall short), with `compiled.save("model.xlsx")` ready whenever a stakeholder asks for the spreadsheet.
8
+ 2. **People doing financial analysis in pure code (no Excel required)**: Run row-by-row financial statements, corkscrew schedules, and cross-table dependency graphs in Python or TypeScript (where columnar DataFrames fall short), with `compiled.save("model.xlsx")` ready whenever a stakeholder asks for the spreadsheet.
9
9
 
10
10
  ## Why f8
11
11
 
@@ -20,11 +20,13 @@ AI agents struggle to manipulate raw spreadsheets (`openpyxl`, Office.js, or GUI
20
20
 
21
21
  - Semantic 2D modeling: Author models with readable table, row, and column identifiers; `f8` handles spatial layout and lowers logic into native Excel formulas.
22
22
  - Compiler-enforced rigor: A 6-pass Rust compiler verifies grid completeness (zero unassigned cells or formula overlaps) and enforces a strict DAG via Tarjan cycle detection.
23
- - Closed-loop verification: Evaluates formulas in memory so AI agents and `pytest` suites can audit tables, trace dependencies, and verify accounting checks in milliseconds, without opening Excel.
23
+ - Closed-loop verification: Evaluates formulas in memory so AI agents and test suites (`pytest`, `vitest`) can audit tables, trace dependencies, and verify accounting checks in milliseconds, without opening Excel.
24
24
  - Verified Excel parity: Matches Excel on all 44 supported functions, including error propagation, type coercion, and the 1900 leap day bug. The [parity workbook](https://github.com/mhcfa/f8/releases/latest/download/excel_parity_verification.xlsx) ships without cached values, so Excel itself recalculates and grades 101 cases on open: exact match for integers, text, dates, and lookups; 1e-9 relative tolerance for floating-point and iterative functions (`IRR`, `XIRR`); exact error type for 23 error cases.
25
25
 
26
26
  ## Getting started
27
27
 
28
+ ### Python
29
+
28
30
  Install from PyPI (package name is `f8-engine`, imported as `f8`):
29
31
 
30
32
  ```bash
@@ -33,6 +35,16 @@ pip install f8-engine
33
35
  uv add f8-engine
34
36
  ```
35
37
 
38
+ ### TypeScript / JavaScript
39
+
40
+ Install from npm (package name is `f8-engine`):
41
+
42
+ ```bash
43
+ npm install f8-engine
44
+ # or
45
+ pnpm add f8-engine
46
+ ```
47
+
36
48
  If you are working with an AI coding agent, `f8` ships with a bundled modeling skill and CLI reference you can drop straight into your workspace:
37
49
 
38
50
  ```bash
@@ -43,6 +55,8 @@ f8 guide --all # streams the full DSL, function, and auditing guide to stdout
43
55
 
44
56
  ## Quick look
45
57
 
58
+ ### Python
59
+
46
60
  ```python
47
61
  from f8 import Model
48
62
 
@@ -81,6 +95,45 @@ print(compiled.table("PPE").to_markdown())
81
95
  compiled.save("forecast.xlsx")
82
96
  ```
83
97
 
98
+ ### TypeScript
99
+
100
+ ```typescript
101
+ import { Model } from "f8-engine";
102
+
103
+ const years = ["2025A", "2026E", "2027E"] as const;
104
+ const capex = { "2025A": 25.0, "2026E": 30.0, "2027E": 35.0 };
105
+ const depr = { "2025A": -15.0, "2026E": -18.0, "2027E": -22.0 };
106
+
107
+ const model = new Model({ name: "Operating Forecast" });
108
+ const sheet = model.addSheet("Summary");
109
+
110
+ const ppe = sheet.addTable("PPE", "PP&E Corkscrew Schedule", { subtitle: "($ in millions)" });
111
+ ppe.addColumn("item", { role: "descriptor", header: "Line Item" });
112
+ for (const year of years) {
113
+ ppe.addColumn(year, { header: year, format: "currency", decimals: 1 });
114
+ }
115
+
116
+ ppe.addRow("beg_balance", {
117
+ cells: { item: "Beginning Balance", "2025A": 100.0 },
118
+ expr: 'PPE["end_balance", col.prev]',
119
+ });
120
+ ppe.addRow("capex", { cells: { item: "Capital Expenditures", ...capex } });
121
+ ppe.addRow("depreciation", { cells: { item: "Depreciation", ...depr } });
122
+ ppe.addRow("end_balance", {
123
+ cells: { item: "Ending Balance" },
124
+ expr: 'SUM(PPE["beg_balance".."depreciation", @col])',
125
+ style: "total",
126
+ });
127
+
128
+ const compiled = model.compile();
129
+
130
+ // Audit evaluated values in memory (or pass { view: "formulas" } to inspect lowered Excel formulas)
131
+ console.log(compiled.table("PPE").toMarkdown());
132
+
133
+ // Emit a live .xlsx workbook with native Excel formulas and styling (you don't have to)
134
+ compiled.save("forecast.xlsx");
135
+ ```
136
+
84
137
  Output:
85
138
 
86
139
  ```markdown
@@ -97,12 +150,11 @@ Output:
97
150
  Inspect compiled deliverables generated from real-world models:
98
151
 
99
152
  - [costco_financial_model.xlsx](https://github.com/mhcfa/f8/releases/latest/download/costco_financial_model.xlsx): Compiled financial model with live Excel formulas.
100
- - [costco_valuation_report.pdf](https://github.com/mhcfa/f8/releases/latest/download/costco_valuation_report.pdf): Valuation report rendered directly from the compiled `f8` model using Quarto, Typst, and Matplotlib.
101
153
  - [lbo_model.xlsx](https://github.com/mhcfa/f8/releases/latest/download/lbo_model.xlsx): Multi-sheet leveraged buyout (LBO) model with transaction structuring, debt waterfall, and returns analysis.
102
154
 
103
155
  ### LBO model demo
104
156
 
105
- Complete model repo: https://github.com/mhcfa/f8-demo
157
+ Complete model repo: https://github.com/mhcfa/f8-demo (this one is written in Python)
106
158
 
107
159
  ![LBO Executive Dashboard](https://github.com/mhcfa/f8/releases/latest/download/lbo-dashboard.png)
108
160
 
@@ -122,25 +174,26 @@ Complete model repo: https://github.com/mhcfa/f8-demo
122
174
  | Superior AI modeling | Being an Excel Ninja |
123
175
  | Readable semantic code and logic | The joy of hunting down a hidden `#REF!` at 2 AM |
124
176
 
125
- Jokes aside, writing models in code gives you 40 years of software infrastructure out of the box, line-by-line `git diff` reviews, automated `pytest` checks, reusable modules, and parametric loops. The only real downsides I can think of are:
177
+ Jokes aside, writing models in code gives you 40 years of software infrastructure out of the box, line-by-line `git diff` reviews, automated `pytest` and `vitest` checks, reusable modules, and parametric loops. The only real downsides I can think of are:
126
178
 
127
179
  1. You can't do whatever you want when it comes to layout in the emitted workbook; everything has to be structured. But you wouldn't want your spreadsheet to be a mess anyway, right?
128
- 2. You have to learn some Python. But that is largely solved by AI now.
129
- 3. Constantly re-compiling just to peek at the Excel workbook can be a bit annoying, so we provide in-memory inspection methods in Python. Once you get used to `print()`, you don't need to open the `.xlsx` all the time (or just ask AI to do it).
180
+ 2. You have to learn some Python or TypeScript. But that is largely solved by AI now.
181
+ 3. Constantly re-compiling just to peek at the Excel workbook can be a bit annoying, so we provide in-memory inspection methods in both SDKs. Once you get used to printing tables in the terminal, you don't need to open the `.xlsx` all the time (or just ask AI to do it).
130
182
  4. There are no circular references or iterative solvers (as per FAST Standard Section 2.01). There is a closed-form formula that solves the revolver circularity problem without circular references anyway (and don't worry, AI knows it).
131
- 5. There is no native Excel chart emission yet (on roadmap), and no Pivot Tables. But since you are already in Python, `pandas` or `polars` handles data aggregation much better.
183
+ 5. There is no native Excel chart emission yet (on roadmap), and no Pivot Tables. But since you are already in code, your language ecosystem handles data aggregation much better.
132
184
 
133
185
  ## Architecture
134
186
 
135
- Under the hood, `f8` is a Python SDK (`python/f8/`) backed by a 6-pass Rust compiler (`crates/f8-core/`):
187
+ Under the hood, `f8` provides Python (`python/f8/`) and TypeScript/WebAssembly (`ts/`, `crates/f8-wasm/`) SDKs backed by a 6-pass Rust compiler (`crates/f8-core/`):
136
188
 
137
189
  `Spec -> IR Expansion -> DAG & Cycle Check -> Topological Evaluation -> Spatial Layout -> Formula Lowering -> .xlsx Emission`
138
190
 
139
191
  - Architecture overview: `docs/architecture.md`
140
192
  - Python modeling skill: `python/f8/skills/f8-modeling/SKILL.md`
141
- - Syntax, grid, and formatting reference: `python/f8/skills/f8-modeling/references/syntax-and-grid.md`
142
- - Function reference: `python/f8/skills/f8-modeling/references/functions.md`
143
- - Auditing and repair reference: `python/f8/skills/f8-modeling/references/auditing-and-repair.md`
193
+ - TypeScript modeling skill: `ts/skills/f8-modeling/SKILL.md`
194
+ - Syntax, grid, and formatting reference: `python/f8/skills/f8-modeling/references/syntax-and-grid.md` / `ts/skills/f8-modeling/references/syntax-and-grid.md`
195
+ - Function reference: `python/f8/skills/f8-modeling/references/functions.md` / `ts/skills/f8-modeling/references/functions.md`
196
+ - Auditing and repair reference: `python/f8/skills/f8-modeling/references/auditing-and-repair.md` / `ts/skills/f8-modeling/references/auditing-and-repair.md`
144
197
 
145
198
  ## License
146
199
 
@@ -1183,6 +1183,20 @@ impl CompiledModel {
1183
1183
  }
1184
1184
  }
1185
1185
 
1186
+ /// Appends an optional display unit suffix to a formatted cell string, splicing inside
1187
+ /// a trailing closing parenthesis for negative accounting strings (e.g., `($50.0)` + `M` -> `($50.0M)`).
1188
+ #[must_use]
1189
+ pub fn apply_unit_suffix(formatted: String, unit: &str) -> String {
1190
+ if formatted.is_empty() || unit.is_empty() {
1191
+ return formatted;
1192
+ }
1193
+ if let Some(stem) = formatted.strip_suffix(')') {
1194
+ format!("{stem}{unit})")
1195
+ } else {
1196
+ format!("{formatted}{unit}")
1197
+ }
1198
+ }
1199
+
1186
1200
  /// Helper to clean quotes and whitespace from an identifier.
1187
1201
  fn clean_id(s: &str) -> &str {
1188
1202
  let trimmed = s.trim();