Convert CamelCase to lowercase_with_underscores

1
camelcase_to_underscore = lambda str: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', '_\\1', str).lower().strip('_')

More like this

  1. Human readable file names decorator by maxk 10 months, 1 week ago
  2. Convert String Uppercase and Lowercase by oraculum 9 months, 4 weeks ago
  3. Convert LaTeX templates to various output formats by blizz 4 years, 11 months ago
  4. Slugify alternative by exogen 4 years, 10 months ago
  5. SQL Function Decorator by proc 3 years, 5 months ago

Comments

(Forgotten your password?)