Field Utilities
Module: ppc_robot_lib.utils.field
- get_base_name(field_name, suffixes, separator='_', max_expansions=3)[source]
Tries to find a suffix that is appended after a
separator
. The suffix must be defined in thesuffixes
dictionary. This can be used to extract base name and a suffix from fixed range field names, e.g.Cost_7_day
.This method tries to find the longest suffix that is present in the dictionary. It finds all separators in the string and tries to match the suffix with the dictionary. If no match is found, it moves onto the next separator, until the
max_expansions
is reached.- Parameters:
- Return type:
- Returns:
Tuple with base name and value for given suffix.