WrightTools.kit.string2identifier

WrightTools.kit.string2identifier(s)[source]

Turn a string into a valid python identifier.

Currently only allows ASCII letters and underscore. Illegal characters are replaced with underscore. This is slightly more opinionated than python 3 itself, and may be refactored in future (see PEP 3131).

Parameters

s (string) – string to convert

Returns

valid python identifier.

Return type

str