| Conditions | 1 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | 1 | import re |
|
| 20 | 1 | def convert_camel_to_snake(value): |
|
| 21 | """Convert string from CamelCase to snake_case |
||
| 22 | |||
| 23 | :param value: CamelCase value |
||
| 24 | :type value: str |
||
| 25 | :return: snake_case converted value |
||
| 26 | :rtype: str |
||
| 27 | """ |
||
| 28 | 1 | s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', value) |
|
| 29 | return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() |
||
| 30 |