# scriban/scriban

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/scriban-scriban).**

3,905 stars · 405 forks · C# · BSD-2-Clause

## Links

- GitHub: https://github.com/scriban/scriban
- Homepage: https://scriban.github.io
- awesome-repositories: https://awesome-repositories.com/repository/scriban-scriban.md

## Topics

`handlebars` `liquid` `mustache` `templating` `templating-engine` `templating-language` `text-templating`

## Description

Scriban is a text templating library and .NET scripting engine used for dynamic text generation. It functions as a template processor and a safe scripting sandbox, providing a secure execution environment that restricts object exposure to prevent unauthorized code execution. The project also includes an abstract syntax tree template parser that allows for programmatic template analysis and modification.

The engine features a dedicated Liquid template engine and compatibility mode, allowing it to parse, execute, and convert templates written in Liquid syntax. It distinguishes itself through a member-exposure filtering system that allows developers to rename, hide, or filter object properties to control how data is accessed within templates.

The library covers a broad range of capabilities including asynchronous template rendering, conditional logic, and collection iteration. It provides built-in utilities for data manipulation, such as mathematical operations, JSON conversion, date and time arithmetic, and extensive text processing using regular expressions. Developers can further extend the engine by defining custom functions and integrating external classes.

The project provides a safe API surface to support publishing as a native binary via Native AOT.

## Tags

### Content Management & Publishing

- [Dynamic Text Generation](https://awesome-repositories.com/f/content-management-publishing/dynamic-text-generation.md) — Uses a .NET scripting engine to produce flexible text output based on data and custom logic.

### Programming Languages & Runtimes

- [.NET Scripting Engines](https://awesome-repositories.com/f/programming-languages-runtimes/net-scripting-engines.md) — Implements a lightweight scripting engine for executing custom logic and dynamic expressions within .NET applications.
- [Template Rendering Engines](https://awesome-repositories.com/f/programming-languages-runtimes/template-rendering-engines.md) — Evaluates compiled templates against data contexts to produce final dynamic text output. ([source](https://scriban.github.io/docs/runtime))
- [Embedded Scripting Logic](https://awesome-repositories.com/f/programming-languages-runtimes/embedded-scripting-logic.md) — Runs scripts containing variables and blocks to manipulate data and control text flow. ([source](https://scriban.github.io/docs/))
- [Function Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/function-definitions.md) — Enables the creation of anonymous or parametric functions to encapsulate reusable logic and computations within templates. ([source](https://scriban.github.io/docs/language))
- [Text Templating Engines](https://awesome-repositories.com/f/programming-languages-runtimes/text-templating-engines.md) — Renders text templates using conditional logic, loops, and data-binding expressions.
- [Conditional Logic](https://awesome-repositories.com/f/programming-languages-runtimes/conditional-logic.md) — Controls execution flow using boolean comparisons, if-else statements, and switch blocks. ([source](https://scriban.github.io/docs/language))
- [Data Type Manipulators](https://awesome-repositories.com/f/programming-languages-runtimes/data-type-manipulators.md) — Processes strings, arrays, dates, and numbers using built-in functions for calculations. ([source](https://scriban.github.io/docs/))
- [Runtime Template Expressions](https://awesome-repositories.com/f/programming-languages-runtimes/expression-evaluators/runtime-template-expressions.md) — Executes custom logic within templates using code blocks and expression statements. ([source](https://scriban.github.io/docs/language))
- [Expression Piping](https://awesome-repositories.com/f/programming-languages-runtimes/expression-piping.md) — Implements a pipe operator that passes the output of one expression directly into another for sequential data transformations.
- [Multi-Syntax Parsing Support](https://awesome-repositories.com/f/programming-languages-runtimes/multi-syntax-parsing-support.md) — Parses scripts using different language specifications to enable migration and compatibility between formats. ([source](https://cdn.jsdelivr.net/gh/scriban/scriban@master/README.md))
- [Object Reflection Utilities](https://awesome-repositories.com/f/programming-languages-runtimes/object-reflection-utilities.md) — Retrieves keys, values, and types from data objects to determine their structure. ([source](https://scriban.github.io/docs/builtins/object))
- [Script Variable Management](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/domain-specific-languages/automation-scripting/script-variable-management.md) — Stores and retrieves data using global and local variables to pass information through scripts. ([source](https://scriban.github.io/docs/language))
- [Scripting Environment Extensions](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-capability-extensions/formula-language-extensions/scripting-environment-extensions.md) — Binds external functions and objects into the execution environment to add specialized capabilities. ([source](https://cdn.jsdelivr.net/gh/scriban/scriban@master/README.md))
- [Scoped Execution Contexts](https://awesome-repositories.com/f/programming-languages-runtimes/scoped-execution-contexts.md) — Resolves variables against a specific object using scoped blocks to change the current execution context. ([source](https://scriban.github.io/docs/language))

### Data & Databases

- [Template](https://awesome-repositories.com/f/data-databases/json-parsers/ast-parsers/template.md) — Converts source text into a visitable abstract syntax tree for programmatic template analysis and modification.
- [Collection Iteration](https://awesome-repositories.com/f/data-databases/collection-iterators/collection-iteration.md) — Loops through arrays or numeric ranges using for and while statements within templates. ([source](https://scriban.github.io/docs/language))
- [Structured Data Manipulation](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-transformation/array-tensor-manipulation/array-manipulation-utilities/structured-data-manipulation.md) — Creates and modifies objects and arrays using dot notation and zero-based indexing. ([source](https://scriban.github.io/docs/language))
- [JSON Serializers](https://awesome-repositories.com/f/data-databases/text-to-json-converters/json-serializers.md) — Serializes objects to JSON format and transforms JSON strings back into objects. ([source](https://scriban.github.io/docs/builtins/object))

### Development Tools & Productivity

- [Runtime Member Visibility Filtering](https://awesome-repositories.com/f/development-tools-productivity/api-documentation-generators/runtime-member-visibility-filtering.md) — Uses boolean rules to determine which public instance fields and properties are visible to the template engine. ([source](https://scriban.github.io/docs/runtime/member-renamer/))
- [Template AST Analysis](https://awesome-repositories.com/f/development-tools-productivity/programmatic-source-analysis/template-ast-analysis.md) — Converts text templates into abstract syntax trees for programmatic analysis and modification.
- [AST-Based Template Parsing](https://awesome-repositories.com/f/development-tools-productivity/template-extensions/template-functions/ast-based-template-parsing.md) — Converts template source text into a visitable abstract syntax tree for programmatic analysis and round-trip text generation.
- [AST to Source Conversion](https://awesome-repositories.com/f/development-tools-productivity/ast-transformation-tools/ast-to-source-conversion.md) — Generates a textual representation from a syntax tree while preserving or removing whitespace. ([source](https://scriban.github.io/docs/runtime/ast/))
- [External Class Bindings](https://awesome-repositories.com/f/development-tools-productivity/external-editor-integrations/external-script-integration/external-class-bindings.md) — Integrates external classes and delegates to extend the functional capabilities of the template engine. ([source](https://scriban.github.io/))
- [AOT-Compatible Libraries](https://awesome-repositories.com/f/development-tools-productivity/native-compilation/native-aot-compilation/aot-compatible-libraries.md) — Provides a restricted API surface that avoids dynamic reflection to enable publishing as a native binary via Native AOT.
- [AOT-Compatible Rendering](https://awesome-repositories.com/f/development-tools-productivity/native-compilation/native-aot-compilation/aot-compatible-rendering.md) — Provides a safe API surface that avoids runtime reflection to support native ahead-of-time compilation. ([source](https://scriban.github.io/docs/runtime/aot-support))
- [Template Extensions](https://awesome-repositories.com/f/development-tools-productivity/template-extensions.md) — Expands available template capabilities by adding custom logic and functions to the execution context. ([source](https://scriban.github.io/docs/runtime))

### Security & Cryptography

- [Execution Sandboxes](https://awesome-repositories.com/f/security-cryptography/execution-sandboxes.md) — Provides a secure execution environment that restricts object exposure to prevent unauthorized code execution. ([source](https://scriban.github.io/))
- [Object Exposure Controls](https://awesome-repositories.com/f/security-cryptography/object-exposure-controls.md) — Limits access to host objects using sanitized data structures to prevent unauthorized code execution within the sandbox.
- [Scripting Sandboxes](https://awesome-repositories.com/f/security-cryptography/scripting-sandboxes.md) — Provides a secure execution environment that restricts host system access via whitelists to prevent unauthorized code execution.
- [Runtime Access Controls](https://awesome-repositories.com/f/security-cryptography/security-and-access-control/runtime-access-controls.md) — Controls which properties and methods are accessible within the sandbox for safe evaluation. ([source](https://cdn.jsdelivr.net/gh/scriban/scriban@master/README.md))

### User Interface & Experience

- [Liquid](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/server-side-rendering-engines/liquid.md) — Evaluates templates written in legacy Liquid syntax to support migration without requiring manual rewriting. ([source](https://scriban.github.io/docs/))
- [Asynchronous Template Rendering](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/list-rendering/asynchronous-rendering/asynchronous-template-rendering.md) — Processes templates using non-blocking operations to maintain stability during heavy concurrent traffic. ([source](https://scriban.github.io/))
- [Script Conversions](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/server-side-rendering-engines/liquid/script-conversions.md) — Provides a dedicated conversion tool to transform scripts from Liquid format to Scriban syntax. ([source](https://scriban.github.io/docs/liquid-support))

### Web Development

- [Text Template Rendering](https://awesome-repositories.com/f/web-development/conditional-template-rendering/text-template-rendering.md) — Processes templates with logic and expressions to produce dynamic text output. ([source](https://cdn.jsdelivr.net/gh/scriban/scriban@master/README.md))
- [Template Logic Customization](https://awesome-repositories.com/f/web-development/custom-template-tags/template-logic-customization.md) — Extends the engine with proprietary functions and filtered object exposure to control rendering.

### Part of an Awesome List

- [Data Manipulation](https://awesome-repositories.com/f/awesome-lists/data/data-manipulation.md) — Transforms strings, arrays, and dates using built-in functions for data processing. ([source](https://scriban.github.io/docs/builtins))

### Scientific & Mathematical Computing

- [General Array Operations](https://awesome-repositories.com/f/scientific-mathematical-computing/array-manipulations/array-concatenations/general-array-operations.md) — Provides functions for sorting, reversing, and joining array elements within templates. ([source](https://scriban.github.io/docs/builtins/array))
- [Arithmetic Operations](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/arithmetic-number-types/arithmetic-operations.md) — Performs basic arithmetic, rounding, and random number generation. ([source](https://scriban.github.io/docs/builtins/math))

### Software Engineering & Architecture

- [Abstract Syntax Tree Parsing](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing.md) — Converts source text into a visitable abstract syntax tree for programmatic analysis and modification. ([source](https://cdn.jsdelivr.net/gh/scriban/scriban@master/README.md))
- [Asynchronous Execution Models](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-execution-models.md) — Implements non-blocking operations during template processing to maintain responsiveness during high-latency data fetches.
- [Dynamic Expression Evaluators](https://awesome-repositories.com/f/software-engineering-architecture/dynamic-expression-evaluators.md) — Evaluates runtime expressions by resolving variables and components to produce dynamic output. ([source](https://scriban.github.io/docs/builtins/object))
- [Template Control Flow](https://awesome-repositories.com/f/software-engineering-architecture/execution-flow-control/template-control-flow.md) — Executes loops and conditional logic to dynamically determine which content to render. ([source](https://scriban.github.io/docs/getting-started/))
- [Template Value Piping](https://awesome-repositories.com/f/software-engineering-architecture/stream-piping/function-composition-operators/template-value-piping.md) — Manipulates template values using built-in operations chained through a pipe operator. ([source](https://scriban.github.io/docs/getting-started))
- [Compatibility Mode Parsing](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsing-engines/compatibility-mode-parsing.md) — Supports interchangeable parsing modes to maintain compatibility with legacy scripts and different language specifications.
