Values are produced by some elements (e.g. ranges) for use in the substitution patterns of other elements.
During substitution, values can be modified and combined with a set of pre-defined operators.
Most of the time, values and operators should "just work".
Sometimes it is necessary to look at the types of values to understand what's happening.
In particular, which operators can be used depends on the value's types.
Parentheses (
and )
can be used to clarify the order of evaluation of the operations.
{EXPRESSION} or {EXPRESSION:FORMAT}
Values have attributes that may contain additional information and which can be accessed with the .
-operator:
VALUE.ATTRIBUTE
The available attributes depend on the value type.
Type-specific values are always made up of only uppercase letters.
Some value-producing elements may attach additional attributes to values (e.g. select).
Attributes, and operators (split into single- and two-argument operators) for all types are listed below.
Note that some elements attach additional attributes to their values.
Text
Strings of text.
Attributes
TEXT
Text
Defined for compatibility with other value types.
Operators
Binary Operators
+
(Text, Text) → Text
Concatenation.
§
(Number, Text) → Text
Left slice.
§
(Text, Number) → Text
Right slice.
Formatting
A subset of Python's format specification mini-language is implemented for Text values: [[fill]align][sign][0][width]
.
Number
Only integer numbers are currently supported.
Number literals (constant values not associated with an element, e.g. 5
, 23
) can be used in operations.
Attributes
TEXT
Text
The text from which the value was parsed or a text representation of the value if it was created directly.
Operators
Unary Operators
+
(Number) → Number
-
(Number) → Number
Binary Operators
*
(Number, Number) → Number (commutative)
Multiplication.
/
(Number, Number) → Number
Division.
%
(Number, Number) → Number
Modulo.
+
(Number, Number) → Number (commutative)
Addition.
-
(Number, Number) → Number
Subtraction.
A subset of Python's format specification mini-language is implemented for Number values: [[fill]align][0][width]
.
Date
UTC dates.
Attributes
TEXT
Text
The text from which the value was parsed or a text representation of the value if it was created directly.
YEAR
Number
MONTH
Number
DAY
Number
HOUR
Number
MINUTE
Number
SECOND
Number
Operators
Binary Operators
+
(Date, DateDelta) → Date (commutative)
-
(Date, DateDelta) → Date
-
(Date, Date) → DateDelta
Date values support a subset of the strftime format codes used by Python's datetime module:
%d
: Day of the month (zero-padded).
%m
: Month (zero-padded).
%y
: Year without century (zero-padded)
%Y
: Year with century (zero-padded)
%H
: Hour (24-hour clock, zero-padded)
%M
: Minute (zero-padded)
%S
: Second (zero-padded)
%%
: A literal percent character.
If no specification is given, Date values default to %Y-%m-%d %H:%M:%S
.
DateDelta
Time intervals or the difference between two Dates.
DateDelta literals (constant values not associated with an element, e.g. 5s
, 23m
, 12h
, 4d
) can be used in operations.
Attributes
TEXT
Text
The text from which the value was parsed or a text representation of the value if it was created directly.
SIGN
Number
Contains +1
if the value is positive, else -1
.
DAYS
Number
Number of full days contained in the interval.
HOURS
Number
Number of full hours contained in the interval after removal of all full days.
MINUTES
Number
Number of full minutes contained in the interval after removal of all full hours.
SECONDS
Number
Number of seconds remaining in the interval after removal of all full minutes.
TOTAL_SECONDS
Number
The total number of seconds contained in the interval.
Operators
Unary Operators
+
(DateDelta) → DateDelta
-
(DateDelta) → DateDelta
Binary Operators
*
(DateDelta, Number) → DateDelta (commutative)
/
(DateDelta, Number) → DateDelta
/
(DateDelta, DateDelta) → Number
+
(DateDelta, DateDelta) → DateDelta (commutative)
-
(DateDelta, DateDelta) → DateDelta
DateDelta does not provide formatting options at the moment.
By default values are formatted as +Dd HH:MM:SS
.
Use attributes to assemble a custom format.