def snake_case()

in etl/utils.py [0:0]


def snake_case(line: str) -> str:
    """Convert a string into a snake_cased string.
    Copied from github.com/mozilla/bigquery-etl/blob/main/bigquery_etl/util/common.py#L27
    """
    # replace non-alphanumeric characters with spaces in the reversed line
    subbed = re.sub(r"[^\w]|_", " ", line[::-1])
    # apply the regex on the reversed string
    words = REV_WORD_BOUND_PAT.split(subbed)
    # filter spaces between words and snake_case and reverse again
    return "_".join([w.lower() for w in words if w.strip()])[::-1]