Atomic Functions ================ .. type:: str Strings in Beanquery should be enclosed in *single* quotes. Example: ``SELECT * FROM payee == 'Supermarket'``. Note: For historical reasons, strings in double quotes can sometimes be used, but if they match a column name, they will be interpreted as this column name, not a string. Do not use them. .. type:: bool This represents a logical value (yes/no). The acceptable values are ``TRUE`` or ``FALSE``. .. type:: set This represents a set of values, for example all accounts that are touched by a transaction. .. type:: int A whole number, -1, 0, 1, 2... .. type:: decimal This is a decimal number, as used for example for amounts of currencies or commodities. Example: 1.25. The following functions can be used to work on basic types: * :func:`~fun.abs` - Absolute value. * :func:`~fun.date` - Convert the argument to a date. * :func:`~fun.decimal` - Convert the object to a decimal number. * :func:`~fun.findfirst` - Filter a string sequence by regular expression and return the first match. * :func:`~fun.getitem` - Get one item from a dict object if it exists, otherwise a default value. * :func:`~fun.grep` - Match a regular expression against a string and return only the matched portion. * :func:`~fun.grepn` - Match a pattern with subgroups against a string and return the subgroup at the index. * :func:`~fun.int` - Convert the object to an integer number. * :func:`~fun.joinstr` - Join a sequence of strings to a single comma-separated string. * :func:`~fun.length` - Compute the length of the argument. * :func:`~fun.lower` - Convert string to lowercase. * :func:`~fun.maxwidth` - Convert the argument to a substring. * :func:`~fun.neg` - Negative value. * :func:`~fun.parse_date` - Parse date from string (first argument). * :func:`~fun.possign` - Correct sign of an Amount based on the usual balance of associated account. * :func:`~fun.round` - Round the argument. * :func:`~fun.safediv` - A division operation that traps division by zero exceptions and outputs zero instead. * :func:`~fun.splitcomp` - Split a string and extract one of its components. * :func:`~fun.subst` - Substitute leftmost non-overlapping occurrences of pattern by replacement. * :func:`~fun.substr` - Extract a substring of the argument. * :func:`~fun.upper` - Convert string to uppercase.