Expressif 0.2.18
See the version list below for details.
dotnet add package Expressif --version 0.2.18
NuGet\Install-Package Expressif -Version 0.2.18
<PackageReference Include="Expressif" Version="0.2.18" />
paket add Expressif --version 0.2.18
#r "nuget: Expressif, 0.2.18"
// Install Expressif as a Cake Addin #addin nuget:?package=Expressif&version=0.2.18 // Install Expressif as a Cake Tool #tool nuget:?package=Expressif&version=0.2.18
Expressif
Expressif is the variable substitution syntax, initially designed for NBi.io.
Expressif allows you to define variables and transformation of these variables (functions), in plain text, which can then be interpreted by the engine. The syntax for the definition of the expression transforming the variable is similar to:
@myVariable | text-to-lower | text-to-pad-right(@myCount, *)
About | Quickstart | Installing | Functions and predicates
About
Continuous integration builds:
Quickstart
Expressif provides a class named Expression to define a chain of functions to apply to a value. The class is expecting the textual representation of the chained functions in its constructor.
var expression = new Expression("lower");
var result = expression.Evaluate("Nikola Tesla");
Assert.That(result, Is.EqualTo("nikola tesla"));
Some functions require parameters, you can specify them between the parenthesis following the function name. Note that literal textual values don’t required quotes surronding them.
var expression = new Expression("remove-chars(a)");
var result = expression.Evaluate("Nikola Tesla");
Assert.That(result, Is.EqualTo("Nikol Tesl"));
You can chain the functions with the operator pipe (|
). The functions are executed from left to right.
var expression = new Expression("lower | remove-chars(a)");
var result = expression.Evaluate("Nikola Tesla");
Assert.That(result, Is.EqualTo("nikol tesl"));
It's possible to use variables as function parameters. The name of the variables must always start by an arobas (@
)
var context = new Context();
context.Variables.Add<char>("myChar", 'k');
var expression = new Expression("lower | remove-chars(@myChar)", context);
var result = expression.Evaluate("Nikola Tesla");
Assert.That(result, Is.EqualTo("niola tesla"));
In addition to the variables that must be scalar values (text, numeric, dateTime ...), you can also add a property-object to the context. A property-object must be a pure C# object, an IDictionnary, an IList, or a DataRow. You can access the properties of the property-object based on the property's name with the syntax [property-name]
var context = new Context();
context.CurrentObject.Set(new { CharToBeRemoved = 't' });
var expression = new Expression("lower | remove-chars([CharToBeRemoved])", context);
var result = expression.Evaluate("Nikola Tesla");
Assert.That(result, Is.EqualTo("nikola esla"));
or based on its position with the syntax #index
(where index is positive number).
var context = new Context();
context.CurrentObject.Set(new List<char>() { 'e', 's' });
var expression = new Expression("lower | remove-chars(#1)", context);
var result = expression.Evaluate("Nikola Tesla");
Assert.That(result, Is.EqualTo("nikola tela"));
It's also possible to use the result of function as the value of a parameter for another function. To achieve this the function as a parameter must be surrounded by curly braces {...}
.
var context = new Context();
context.Variables.Add<int>("myVar", 6);
context.CurrentObject.Set(new List<int>() { 15, 8, 3 });
var expression = new Expression("lower | skip-last-chars( {@myVar | numeric-to-subtract(#2) })", context);
var result = expression.Evaluate("Nikola Tesla");
Assert.That(result, Is.EqualTo("nikola te"));
Installing
Install in the usual .NET fashion:
Install-Package Expressif
Supported functions and predicates
Functions
Scope | Name | Aliases |
---|---|---|
IO | creation-datetime | file-to-creation-datetime |
IO | creation-datetime-utc | file-to-creation-datetime-utc |
IO | directory | path-to-directory |
IO | extension | path-to-extension |
IO | filename | path-to-filename |
IO | filename-without-extension | path-to-filename-without-extension |
IO | root | path-to-root |
IO | size | file-to-size |
IO | update-datetime | file-to-update-datetime |
IO | update-datetime-utc | file-to-update-datetime-utc |
Numeric | add | numeric-to-add |
Numeric | ceiling | numeric-to-ceiling |
Numeric | clip | numeric-to-clip |
Numeric | decrement | numeric-to-decrement |
Numeric | divide | numeric-to-divide |
Numeric | floor | numeric-to-floor |
Numeric | increment | numeric-to-increment |
Numeric | integer | numeric-to-integer |
Numeric | invert | numeric-to-invert |
Numeric | multiply | numeric-to-multiply |
Numeric | null-to-zero | |
Numeric | round | numeric-to-round |
Numeric | subtract | numeric-to-subtract |
Special | any-to-any | |
Special | neutral | |
Special | null-to-value | |
Special | value-to-value | |
Temporal | age | dateTime-to-age |
Temporal | back | dateTime-to-back, dateTime-to-subtract |
Temporal | ceiling-hour | dateTime-to-ceiling-hour |
Temporal | ceiling-minute | dateTime-to-ceiling-minute |
Temporal | clamp | dateTime-to-clamp, dateTime-to-clip |
Temporal | datetime-to-date | dateTime-to-datetime-to-date |
Temporal | first-of-month | dateTime-to-first-of-month |
Temporal | first-of-year | dateTime-to-first-of-year |
Temporal | floor-hour | dateTime-to-floor-hour |
Temporal | floor-minute | dateTime-to-floor-minute |
Temporal | forward | dateTime-to-forward, dateTime-to-add |
Temporal | invalid-to-date | |
Temporal | last-of-month | dateTime-to-last-of-month |
Temporal | last-of-year | dateTime-to-last-of-year |
Temporal | local-to-utc | |
Temporal | next-day | dateTime-to-next-day |
Temporal | next-month | dateTime-to-next-month |
Temporal | next-year | dateTime-to-next-year |
Temporal | null-to-date | |
Temporal | previous-day | dateTime-to-previous-day |
Temporal | previous-month | dateTime-to-previous-month |
Temporal | previous-year | dateTime-to-previous-year |
Temporal | set-time | dateTime-to-set-time |
Temporal | utc-to-local | |
Text | empty-to-null | |
Text | first-chars | text-to-first-chars |
Text | html-to-text | |
Text | last-chars | text-to-last-chars |
Text | length | text-to-length |
Text | lower | text-to-lower |
Text | mask-to-text | |
Text | null-to-empty | |
Text | pad-left | text-to-pad-left |
Text | pad-right | text-to-pad-right |
Text | prefix | text-to-prefix |
Text | remove-chars | text-to-remove-chars |
Text | skip-first-chars | text-to-skip-first-chars |
Text | skip-last-chars | text-to-skip-last-chars |
Text | suffix | text-to-suffix |
Text | text-to-after | text-to-text-to-after |
Text | text-to-before | text-to-text-to-before |
Text | text-to-datetime | |
Text | text-to-html | |
Text | text-to-mask | |
Text | token | text-to-token |
Text | token-count | text-to-token-count |
Text | trim | text-to-trim |
Text | upper | text-to-upper |
Text | whitespaces-to-empty | blank-to-empty |
Text | whitespaces-to-null | blank-to-null |
Text | without-diacritics | text-to-without-diacritics |
Text | without-whitespaces | text-to-without-whitespaces |
Predicates
Scope | Name | Aliases |
---|---|---|
Boolean | false | boolean-is-false |
Boolean | false-or-null | boolean-is-false-or-null |
Boolean | identical-to | boolean-is-identical-to |
Boolean | true | boolean-is-true |
Boolean | true-or-null | boolean-is-true-or-null |
Numeric | equal-to | numeric-is-equal-to |
Numeric | even | numeric-is-even |
Numeric | greater-than | numeric-is-greater-than |
Numeric | greater-than-or-equal | numeric-is-greater-than-or-equal |
Numeric | integer | numeric-is-integer |
Numeric | less-than | numeric-is-less-than |
Numeric | less-than-or-equal | numeric-is-less-than-or-equal |
Numeric | modulo | numeric-is-modulo |
Numeric | odd | numeric-is-odd |
Numeric | within-interval | numeric-is-within-interval |
Numeric | zero-or-null | numeric-is-zero-or-null |
Special | null | is-null |
Temporal | after | dateTime-is-after |
Temporal | after-or-same-instant | dateTime-is-after-or-same-instant |
Temporal | before | dateTime-is-before |
Temporal | before-or-same-instant | dateTime-is-before-or-same-instant |
Temporal | contained-in | dateTime-is-contained-in |
Temporal | on-the-day | dateTime-is-on-the-day |
Temporal | on-the-hour | dateTime-is-on-the-hour |
Temporal | on-the-minute | dateTime-is-on-the-minute |
Temporal | same-instant | dateTime-is-same-instant |
Text | any-of | text-is-any-of |
Text | contains | text-contains |
Text | empty | text-is-empty |
Text | empty-or-null | text-is-empty-or-null |
Text | ends-with | text-ends-with |
Text | equivalent-to | text-is-equivalent-to |
Text | lower-case | text-is-lower-case |
Text | matches-date | text-matches-date |
Text | matches-datetime | text-matches-datetime |
Text | matches-numeric | text-matches-numeric |
Text | matches-regex | text-matches-regex |
Text | matches-time | text-matches-time |
Text | sorted-after | text-is-sorted-after |
Text | sorted-after-or-equivalent-to | text-is-sorted-after-or-equivalent-to |
Text | sorted-before | text-is-sorted-before |
Text | sorted-before-or-equivalent-to | text-is-sorted-before-or-equivalent-to |
Text | starts-with | text-starts-with |
Text | upper-case | text-is-upper-case |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Expressif:
Package | Downloads |
---|---|
NBi.Extensibility
Package Description |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Expressif:
Repository | Stars |
---|---|
Seddryck/NBi
NBi is a testing framework (add-on to NUnit) for Business Intelligence and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# or Java code to specify your tests! Either, you don't need Visual Studio or Eclipse to compile your test suite. Just create an Xml file and let the framework interpret it and play your tests. The framework is designed as an add-on of NUnit but with the possibility to port it easily to other testing frameworks.
|
Version | Downloads | Last updated |
---|---|---|
1.10.11 | 62 | 1/20/2025 |
1.10.10 | 73 | 1/20/2025 |
1.10.9 | 76 | 1/10/2025 |
1.10.8 | 79 | 12/31/2024 |
1.10.7 | 77 | 12/31/2024 |
1.10.6 | 83 | 12/30/2024 |
1.10.5 | 91 | 12/26/2024 |
1.10.4 | 84 | 12/22/2024 |
1.10.1 | 87 | 12/16/2024 |
1.10.0 | 93 | 12/1/2024 |
1.9.11 | 101 | 11/22/2024 |
1.9.10 | 91 | 11/16/2024 |
1.9.9 | 156 | 9/14/2024 |
1.9.7 | 114 | 9/9/2024 |
1.9.6 | 110 | 9/8/2024 |
1.9.5 | 109 | 9/2/2024 |
1.9.4 | 115 | 8/26/2024 |
1.9.3 | 130 | 8/26/2024 |
1.9.2 | 135 | 8/24/2024 |
1.9.1 | 134 | 8/22/2024 |
1.9.0 | 109 | 7/29/2024 |
1.8.12 | 88 | 7/29/2024 |
1.8.11 | 93 | 7/29/2024 |
1.8.10 | 108 | 5/25/2024 |
1.8.9 | 111 | 5/14/2024 |
1.8.8 | 127 | 3/18/2024 |
1.8.7 | 112 | 3/18/2024 |
1.8.6 | 132 | 3/16/2024 |
1.8.5 | 123 | 2/27/2024 |
1.8.4 | 130 | 2/22/2024 |
1.8.3 | 117 | 2/17/2024 |
1.8.2 | 134 | 2/4/2024 |
1.8.1 | 116 | 1/30/2024 |
1.8.0 | 148 | 1/13/2024 |
1.7.0 | 117 | 1/13/2024 |
1.6.2 | 125 | 1/11/2024 |
1.6.1 | 111 | 1/11/2024 |
1.6.0 | 147 | 1/7/2024 |
1.5.0 | 135 | 1/7/2024 |
1.4.8 | 131 | 1/6/2024 |
1.4.7 | 133 | 1/6/2024 |
1.4.5 | 144 | 1/6/2024 |
1.4.4 | 135 | 1/6/2024 |
1.4.3 | 152 | 1/1/2024 |
1.4.2 | 125 | 12/31/2023 |
1.4.1 | 138 | 12/30/2023 |
1.4.0 | 128 | 12/30/2023 |
1.3.0 | 129 | 12/29/2023 |
1.2.0 | 125 | 12/29/2023 |
1.1.2 | 134 | 12/28/2023 |
1.1.1 | 126 | 12/28/2023 |
1.1.0 | 130 | 12/27/2023 |
1.0.0 | 135 | 12/22/2023 |
0.8.0 | 122 | 12/22/2023 |
0.7.0 | 109 | 12/22/2023 |
0.6.0 | 134 | 12/22/2023 |
0.5.0 | 137 | 12/22/2023 |
0.4.0 | 138 | 12/21/2023 |
0.3.48 | 134 | 12/21/2023 |
0.3.47 | 179 | 12/5/2023 |
0.3.46 | 153 | 12/5/2023 |
0.3.45 | 123 | 12/5/2023 |
0.3.44 | 136 | 12/5/2023 |
0.3.43 | 155 | 12/3/2023 |
0.3.39 | 149 | 12/3/2023 |
0.3.36 | 163 | 11/9/2023 |
0.3.35 | 146 | 11/6/2023 |
0.3.34 | 159 | 9/2/2023 |
0.3.33 | 161 | 8/17/2023 |
0.3.32 | 194 | 8/14/2023 |
0.3.31 | 190 | 8/9/2023 |
0.3.30 | 173 | 8/9/2023 |
0.3.29 | 188 | 8/8/2023 |
0.3.28 | 202 | 7/1/2023 |
0.3.27 | 174 | 6/14/2023 |
0.3.25 | 219 | 3/7/2023 |
0.3.24 | 262 | 3/5/2023 |
0.3.23 | 236 | 3/5/2023 |
0.3.22 | 242 | 3/5/2023 |
0.3.21 | 247 | 3/5/2023 |
0.3.20 | 244 | 3/5/2023 |
0.3.18 | 317 | 1/3/2023 |
0.3.17 | 313 | 1/3/2023 |
0.3.15 | 313 | 12/31/2022 |
0.3.14 | 308 | 12/31/2022 |
0.3.13 | 308 | 12/30/2022 |
0.3.11 | 337 | 12/29/2022 |
0.3.9 | 300 | 12/29/2022 |
0.3.8 | 300 | 12/29/2022 |
0.3.7 | 328 | 12/29/2022 |
0.3.6 | 315 | 12/28/2022 |
0.3.5 | 311 | 12/28/2022 |
0.3.4 | 323 | 12/28/2022 |
0.3.3 | 313 | 12/28/2022 |
0.3.2 | 304 | 12/26/2022 |
0.3.1 | 322 | 12/26/2022 |
0.3.0 | 320 | 12/26/2022 |
0.2.26 | 322 | 12/24/2022 |
0.2.25 | 324 | 12/23/2022 |
0.2.24 | 324 | 12/22/2022 |
0.2.23 | 307 | 12/22/2022 |
0.2.22 | 322 | 12/21/2022 |
0.2.21 | 332 | 12/21/2022 |
0.2.20 | 349 | 12/19/2022 |
0.2.18 | 340 | 12/18/2022 |
0.2.15 | 330 | 12/18/2022 |
0.2.14 | 318 | 12/18/2022 |
0.2.13 | 314 | 12/18/2022 |
0.2.12 | 329 | 12/18/2022 |
0.2.9 | 324 | 12/11/2022 |
0.2.8 | 314 | 12/11/2022 |
0.2.7 | 306 | 12/10/2022 |
0.2.6 | 317 | 12/10/2022 |
0.2.5 | 315 | 12/10/2022 |
0.2.4 | 335 | 12/6/2022 |
0.2.3 | 317 | 12/6/2022 |
0.2.2 | 359 | 11/26/2022 |
0.2.1 | 360 | 11/22/2022 |
0.2.0 | 349 | 11/21/2022 |
0.1.17 | 367 | 11/17/2022 |
0.1.16 | 361 | 11/15/2022 |
0.1.15 | 399 | 11/13/2022 |
0.1.13 | 382 | 11/12/2022 |
0.1.11 | 350 | 11/12/2022 |
0.1.10 | 352 | 11/12/2022 |
0.1.7 | 368 | 11/12/2022 |
0.1.6 | 368 | 11/12/2022 |