CostForecast.Engine 1.0.3

dotnet add package CostForecast.Engine --version 1.0.3
                    
NuGet\Install-Package CostForecast.Engine -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CostForecast.Engine" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CostForecast.Engine" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="CostForecast.Engine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CostForecast.Engine --version 1.0.3
                    
#r "nuget: CostForecast.Engine, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CostForecast.Engine@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CostForecast.Engine&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=CostForecast.Engine&version=1.0.3
                    
Install as a Cake Tool

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

  1. Initialize the engine (typically via Dependency Injection):

    // Registration
    services.AddSingleton<IEngine, SumvelaEngine>();
    
  2. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 90 3/5/2026
1.0.2 83 3/5/2026