Source code for core.utils

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Different general-purpose functions used in the implementation of the core library.
"""

import re
import sys

from params.parameters import get_app_args


[docs]def camel_case_to_snake_case(name: str) -> str: """Converts a camel-case string into its snake-case representation""" s1 = re.sub(r'(.)([A-Z][a-z]+)', r'\1_\2', name) return re.sub(r'([a-z0-9])([A-Z])', r'\1_\2', s1).lower()