fitlins.utils.strings module

fitlins.utils.strings.snake_to_camel(string)[source]
fitlins.utils.strings.to_alphanum(string)[source]

Convert string to alphanumeric

Replaces all other characters with underscores and then converts to camelCase

>>> to_alphanum('abc123')
'abc123'
>>> to_alphanum('a four word phrase')
'aFourWordPhrase'
>>> to_alphanum('hyphen-separated')
'hyphenSeparated'
>>> to_alphanum('object.attribute')
'objectAttribute'
>>> to_alphanum('array[index]')
'arrayIndex'
>>> to_alphanum('array[0]')
'array0'
>>> to_alphanum('snake_case')
'snakeCase'