{"id":13458264,"url":"https://github.com/scriban/scriban","last_synced_at":"2026-04-01T23:24:04.933Z","repository":{"id":41062075,"uuid":"50355666","full_name":"scriban/scriban","owner":"scriban","description":"A fast, powerful, safe and lightweight scripting language and engine for .NET","archived":false,"fork":false,"pushed_at":"2026-03-27T21:17:07.000Z","size":3435,"stargazers_count":3845,"open_issues_count":0,"forks_count":406,"subscribers_count":66,"default_branch":"master","last_synced_at":"2026-03-28T02:58:03.264Z","etag":null,"topics":["handlebars","liquid","mustache","templating","templating-engine","templating-language","text-templating"],"latest_commit_sha":null,"homepage":"https://scriban.github.io","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scriban.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["xoofx"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-01-25T14:26:37.000Z","updated_at":"2026-03-27T21:17:11.000Z","dependencies_parsed_at":"2024-01-05T20:52:12.734Z","dependency_job_id":"293de6db-9748-4ca2-99c6-aa7ba3acb383","html_url":"https://github.com/scriban/scriban","commit_stats":{"total_commits":1047,"total_committers":70,"mean_commits":"14.957142857142857","dds":"0.20534861509073543","last_synced_commit":"42ad256ad1686d23fe72af6b88d68fe1e2cc6543"},"previous_names":["lunet-io/scriban"],"tags_count":136,"template":false,"template_full_name":null,"purl":"pkg:github/scriban/scriban","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriban%2Fscriban","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriban%2Fscriban/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriban%2Fscriban/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriban%2Fscriban/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scriban","download_url":"https://codeload.github.com/scriban/scriban/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriban%2Fscriban/sbom","scorecard":{"id":806266,"data":{"date":"2025-08-11","repo":{"name":"github.com/scriban/scriban","commit":"18495d3a916a9271278a8e55b1e62320ba165ad0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":5,"reason":"1 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/CI.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":6,"reason":"Found 13/20 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.txt:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: license.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/CI.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/scriban/scriban/CI.yml/master?enable=pin","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T11:50:31.363Z","repository_id":41062075,"created_at":"2025-08-23T11:50:31.363Z","updated_at":"2025-08-23T11:50:31.363Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31139834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-29T08:59:23.639Z","status":"ssl_error","status_checked_at":"2026-03-29T08:57:18.852Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["handlebars","liquid","mustache","templating","templating-engine","templating-language","text-templating"],"created_at":"2024-07-31T09:00:49.145Z","updated_at":"2026-04-01T23:24:04.922Z","avatar_url":"https://github.com/scriban.png","language":"C#","readme":"# scriban [![ci](https://github.com/scriban/scriban/actions/workflows/CI.yml/badge.svg)](https://github.com/scriban/scriban/actions/workflows/CI.yml) [![Coverage Status](https://coveralls.io/repos/github/scriban/scriban/badge.svg?branch=master)](https://coveralls.io/github/scriban/scriban?branch=master) [![NuGet](https://img.shields.io/nuget/v/Scriban.svg)](https://www.nuget.org/packages/Scriban/)\n\n\u003cimg align=\"right\" width=\"160px\" height=\"160px\" src=\"img/scriban.png\"\u003e\n\nScriban is a fast, powerful, safe and lightweight scripting language and engine for .NET, which was primarily developed for text templating with a compatibility mode for parsing `liquid` templates.\n\nToday, not only Scriban can be used in text templating scenarios, but also can be integrated as a **general scripting engine**: For example, Scriban is at the core of the scripting engine for [kalk](https://github.com/xoofx/kalk), a command line calculator application for developers.\n\n```csharp\n// Parse a scriban template\nvar template = Template.Parse(\"Hello {{name}}!\");\nvar result = template.Render(new { Name = \"World\" }); // =\u003e \"Hello World!\" \n```\n\nParse a Liquid template using the Liquid language:\n\n```csharp\n// Parse a liquid template\nvar template = Template.ParseLiquid(\"Hello {{name}}!\");\nvar result = template.Render(new { Name = \"World\" }); // =\u003e \"Hello World!\" \n```\n\nThe language is very versatile, easy to read and use, similar to [liquid](https://shopify.github.io/liquid/) templates:\n\n```csharp\nvar template = Template.Parse(@\"\n\u003cul id='products'\u003e\n  {{ for product in products }}\n    \u003cli\u003e\n      \u003ch2\u003e{{ product.name }}\u003c/h2\u003e\n           Price: {{ product.price }}\n           {{ product.description | string.truncate 15 }}\n    \u003c/li\u003e\n  {{ end }}\n\u003c/ul\u003e\n\");\nvar result = template.Render(new { Products = this.ProductList });\n```\n\nScriban can also be used in pure scripting context without templating (`{{` and `}}`) and can help you to create your own small DSL.\n\n\u003e [!NOTE]\n\u003e By default, Properties and methods of .NET objects are automatically exposed with lowercase and `_` names. It means that a property like `MyMethodIsNice` will be exposed as `my_method_is_nice`. This is the default convention, originally to match the behavior of liquid templates.\n\u003e If you want to change this behavior, you need to use a [`MemberRenamer`](https://scriban.github.io/docs/runtime/member-renamer/#member-renamer) delegate\n\n## Highlights\n\n- Fully visitable AST with `ScriptVisitor`, parent links on `ScriptNode`, and round-trippable formatting with [`Template.ToText`](https://scriban.github.io/docs/runtime/ast/#ast-to-text).\n- Flexible language features including hexadecimal/binary numbers, large integers, parametric and inline functions, optional member access (`?.`), and conditional expressions.\n- Multiple parsing modes through `ScriptLang` and `ScriptMode`, including Scriban, Liquid, and Scientific parsing.\n- Fine-grained runtime control through `TemplateContext` options such as relaxed member, function, target, and indexer access.\n- Runtime evaluation helpers such as `object.eval` and `object.eval_template`.\n- Async rendering support with `Template.RenderAsync`.\n- Native AOT and trimming-friendly APIs on .NET 8+ when using the AOT-safe surface documented in the runtime guides.\n  \n## Features\n\n- An **extensible sandbox execution model**: You have the full control about which Scripting objects (and so properties and methods) are accessible from Scriban templates.\n- Very **efficient**, **fast** parser and a **lightweight** runtime. CPU and Garbage Collector friendly.\n- Powered by a Lexer/Parser providing a **full Abstract Syntax Tree, fast, versatile and robust**, more efficient than regex based parsers.\n  - Precise source code location (path, column and line) for error reporting\n  - **Write an AST to a script textual representation**, with [`Template.ToText`](https://scriban.github.io/docs/runtime/ast/#ast-to-text), allowing to manipulate scripts in memory and re-save them to the disk, useful for **roundtrip script update scenarios**\n- **Compatible with `liquid`** by using the `Template.ParseLiquid` method\n  - While the `liquid` language is less powerful than scriban, this mode allows to migrate from `liquid` to `scriban` language easily\n  - With the [AST to text](https://scriban.github.io/docs/runtime/ast/#ast-to-text) mode, you can convert a `liquid` script to a scriban script using `Template.ToText` on a template parsed with `Template.ParseLiquid`\n  - As the liquid language is not strictly defined and there are in fact various versions of liquid syntax, there are restrictions while using liquid templates with scriban, see the document [liquid support in scriban](https://scriban.github.io/docs/liquid-support/) for more details.\n- **Extensible runtime** providing many extensibility points\n- Support for `async`/`await` evaluation of scripts (e.g `Template.RenderAsync`)\n- Precise control of whitespace text output\n- Full featured language including `if`/`else`/`for`/`while`, expressions (`x = 1 + 2`), conditions... etc.\n- Function calls and pipes (`myvar | string.capitalize`)\n  - Custom functions directly into the language via `func` statement and allow **function pointers/delegates** via the `alias @ directive`\n  - Bind .NET custom functions from the runtime API with many options for interfacing with .NET objects.\n- Complex objects (javascript/json like objects `x = {mymember: 1}`) and arrays (e.g `x = [1,2,3,4]`)\n- Allow to pass a block of statements to a function, typically used by the `wrap` statement\n- Several built-in functions: `array`, `date`, `html`, `math`, `object`, `regex`, `string`, `timespan`\n- Multi-line statements without having to embrace each line by `{{...}}`\n- Safe parser and safe runtime, allowing you to control what objects and functions are exposed\n- **[AOT and trimming compatible](https://scriban.github.io/docs/runtime/aot-support/)** on .NET 8+. `ScriptObject`-based APIs produce zero linker warnings for Native AOT publishing\n\n## Syntax Coloring\n\nYou can install the [Scriban Extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=xoofx.scriban) to get syntax coloring for scriban scripts (without HTML) and scriban html files.\n\n## Documentation\n\nThe full documentation is available at **https://scriban.github.io**.\n\n## Installation\n\nScriban is available as a NuGet package: [![NuGet](https://img.shields.io/nuget/v/Scriban.svg)](https://www.nuget.org/packages/Scriban/)\n\n```sh\ndotnet add package Scriban\n```\n\nThe package targets `netstandard2.0` and `net8.0`, so it works with .NET 6+, .NET Framework 4.7.2+, and other compatible runtimes.\n\nAlso the [Scriban.Signed](https://www.nuget.org/packages/Scriban.Signed/) NuGet package provides signed assemblies.\n\n## Source Embedding\n\nThe package includes Scriban source files so that you can internalize Scriban into your project instead of consuming it only as a binary dependency. This is useful in environments where NuGet references are not convenient, such as Roslyn source generators.\n\n\u003e [!WARNING]\n\u003e Currently, Scriban source files are not marked as read-only in this mode. Do not modify them unless you intend to affect other projects on the same machine that use the embedded sources. Use this feature at your own risk.\n\nIn order to activate this feature you need to:\n\n- Set the property `PackageScribanIncludeSource` to `true` in your project:\n  ```xml\n  \u003cPropertyGroup\u003e\n    \u003cPackageScribanIncludeSource\u003etrue\u003c/PackageScribanIncludeSource\u003e\n  \u003c/PropertyGroup\u003e\n  ```\n- Add the `IncludeAssets=\"Build\"` to the NuGet PackageReference for Scriban:\n  ```xml\n  \u003cItemGroup\u003e\n    \u003cPackageReference Include=\"Scriban\" Version=\"x.y.z\" IncludeAssets=\"Build\" /\u003e\n  \u003c/ItemGroup\u003e\n  ```\n- Compile the embedded sources with C# 9 or later and nullable annotations enabled:\n  ```xml\n  \u003cPropertyGroup\u003e\n    \u003cLangVersion\u003e9.0\u003c/LangVersion\u003e\n    \u003cNullable\u003eenable\u003c/Nullable\u003e\n  \u003c/PropertyGroup\u003e\n  ```\n\nIf you are targeting `netstandard2.0` or `.NET Framework 4.7.2+`, you will also need the supporting packages Scriban compiles against. They can already come from another dependency in your project:\n\n```xml\n\u003cItemGroup\u003e\n  \u003cPackageReference Include=\"Microsoft.CSharp\" Version=\"4.7.0\" /\u003e\n  \u003cPackageReference Include=\"System.Threading.Tasks.Extensions\" Version=\"4.6.3\" /\u003e\n  \u003cPackageReference Include=\"PolySharp\" Version=\"1.15.0\"\u003e\n    \u003cPrivateAssets\u003eall\u003c/PrivateAssets\u003e\n    \u003cIncludeAssets\u003eruntime; build; native; contentfiles; analyzers\u003c/IncludeAssets\u003e\n  \u003c/PackageReference\u003e\n\u003c/ItemGroup\u003e\n```\n\n\u003e [!NOTE]\n\u003e `Scriban.targets` already defines `SCRIBAN_NO_SYSTEM_TEXT_JSON` and `SCRIBAN_SOURCE_INCLUDE` when `PackageScribanIncludeSource` is `true`, so you do not need to add these constants manually.\n\u003e\n\u003e In this mode, all Scriban types are marked as `internal`.\n\u003e\n\u003e `System.Text.Json`-based features are intentionally disabled in source-embedding mode. This includes helpers such as `object.from_json`, `object.to_json`, and direct `JsonElement` import support.\n\n## License\n\nThis software is released under the [BSD-Clause 2 license](https://opensource.org/licenses/BSD-2-Clause). \n\n## Related projects\n\n* [dotliquid](https://github.com/dotliquid/dotliquid): .NET port of the liquid templating engine\n* [Fluid](https://github.com/sebastienros/fluid/) .NET liquid templating engine\n* [Nustache](https://github.com/jdiamond/Nustache): Logic-less templates for .NET\n* [Handlebars.Net](https://github.com/rexm/Handlebars.Net): .NET port of handlebars.js\n* [Textrude](https://github.com/NeilMacMullen/Textrude): UI and CLI tools to turn CSV/JSON/YAML models into code using Scriban templates\n* [NTypewriter](https://github.com/NeVeSpl/NTypewriter): VS extension to turn C# code into documentation/TypeScript/anything using Scriban templates\n  \n## Online Demo\n\n* Main site and playground: https://scriban.github.io\n\n\n## Sponsors\n\nSupports this project with a monthly donation and help me continue improving it. \\[[Become a sponsor](https://github.com/sponsors/xoofx)\\]\n\n[\u003cimg src=\"https://github.com/lilith.png?size=200\" width=\"64px;\" style=\"border-radius: 50%\" alt=\"lilith\"/\u003e](https://github.com/lilith) Lilith River, author of [Imageflow Server, an easy on-demand\nimage editing, optimization, and delivery server](https://github.com/imazen/imageflow-server)\n\n## Credits\n\nAdapted logo `Puzzle` by [Andrew Doane](https://thenounproject.com/andydoane/) from the Noun Project\n\n## Author\n\nAlexandre Mutel aka [xoofx](https://xoofx.github.io).\n","funding_links":["https://github.com/sponsors/xoofx"],"categories":["C\\#","others","C#","C# #","Libraries, Frameworks and Tools"],"sub_categories":["Template Engine"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriban%2Fscriban","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriban%2Fscriban","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriban%2Fscriban/lists"}