Data Manipulation Utilities
List of Functions
Getting Started
Import the data_utils
integration helper in the Integration Before Hook to expose the helper functions to the integration’s namespace.
extract_chars()
Takes str
or Flex(None)
input and returns spliced output using typical python string splicing logic. Returns None
for Flex(None)
extract_digits()
Given a str
or Flex(None)
input, and outputs all digits.
percent_to_decimal()
Given an int
, float
, Decimal
, or number in str
format and returns value in decimal format.
round_half_up()
Given an input of float
, int
, Decimal
, or number in str
format, outputs a Decimal
number rounded to n decimal places. This implements the typical round half up strategy where 0.5 rounds up.
get_current_date_string()
Given a time zone and datetime format input, returns the current date str
in the specified format.
All timezones in the pytz package are supported. Here are the major US time zones:
US/Central
US/Eastern
US/Mountain
US/Pacific
You can use the following Python to capture the full list:
convert_date_string()
Given a date string and it’s date time format, converts to the specified output format as a date string. (default output format is "%Y-%m-%d"
)\
IndexGenerator
This class is intended to generate numbers sequentially. A typical use case would be to define field mapping paths with next()
and .last
so that the Field Mapping paths are dynamically generated and an Include For Each isn’t necessary.
Be sure to keep()
the instance of IndexGenerator in the relevant hook or an AttributeError exception will be thrown.
e.g:keep(custom_idx = data_utils.IndexGenerator())
Be aware that Glyue evaluates the Value Column on the Field Mapping table before the Field column which can result in unintended behavior. e.g.:
Last updated