The current implementation of the string conversion logic does not strike me as optimal.
Albeit it is working, I wonder whether using an approach to detect string case, acronyms and segmenting into substrings, as well as the final reassembling of those, is the most elegant approach. Likely basing these types of operations on regular expression may provide a much more succinct code.
On starting point:
https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case
This idea is to be explored.
The current implementation of the string conversion logic does not strike me as optimal.
Albeit it is working, I wonder whether using an approach to detect string case, acronyms and segmenting into substrings, as well as the final reassembling of those, is the most elegant approach. Likely basing these types of operations on
regular expressionmay provide a much more succinct code.On starting point:
https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case
This idea is to be explored.