CostForecast.Engine
1.0.3
dotnet add package CostForecast.Engine --version 1.0.3
NuGet\Install-Package CostForecast.Engine -Version 1.0.3
<PackageReference Include="CostForecast.Engine" Version="1.0.3" />
<PackageVersion Include="CostForecast.Engine" Version="1.0.3" />
<PackageReference Include="CostForecast.Engine" />
paket add CostForecast.Engine --version 1.0.3
#r "nuget: CostForecast.Engine, 1.0.3"
#:package CostForecast.Engine@1.0.3
#addin nuget:?package=CostForecast.Engine&version=1.0.3
#tool nuget:?package=CostForecast.Engine&version=1.0.3
Sumvela Engine
The Extensible .NET Calculation Engine for complex formulas.
Overview
Sumvela Engine is a powerful calculation engine designed for financial modeling, cost forecasting, and complex simulations. It provides a robust DSL (Domain Specific Language) that bridges the gap between spreadsheet flexibility and structured software performance.
Features
- Blazing Fast: Compiled DSL execution.
- Fluent API: Clean Builder pattern for configuring requests.
- Complex Inputs: Support for numbers, text, JSON, and arrays of objects.
- Tree-Sitter Powered: High-quality parsing and error reporting.
Getting Started
Initialize the engine (typically via Dependency Injection):
// Registration services.AddSingleton<IEngine, SumvelaEngine>();Execute a calculation:
var result = await engine.Compile("total = base_price * qty") .WithInputs(new Dictionary<string, object?> { { "base_price", 100 }, { "qty", 5 } }) .RunAsync(); Console.WriteLine(result.Results["total"]); // 500
Advanced Use Cases
Complex Inputs (JSON & Arrays)
The engine can handle complex input types directly using the GET function and MAP expressions.
var dsl = @"
// Accessing JSON object properties
settings: Input(""settings"")
tax_rate = GET(settings, ""tax_rate"")
// Summing values from an array of objects
orders: Input(""orders"")
price: Param
quantity: Param
total_revenue = SUM(MAP(orders, price * quantity))
// String concatenation
label = CONCAT(""Total: "", total_revenue)
";
var result = await engine.Compile(dsl)
.WithInputs(new Dictionary<string, object?> {
{ "settings", "{\"tax_rate\": 0.15}" }, // JSON string
{ "orders", new[] {
new Dictionary<string, object?> { { "price", 10.0 }, { "quantity", 2 } },
new Dictionary<string, object?> { { "price", 25.0 }, { "quantity", 1 } }
}} // Array of complex objects
})
.RunAsync();
Documentation
For detailed documentation, visit sumvela.com.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- TreeSitter (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.