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 1 year, 1 month ago
  2. Convert String Uppercase and Lowercase by oraculum 1 year, 1 month ago
  3. Convert LaTeX templates to various output formats by blizz 5 years, 2 months ago
  4. SQL Function Decorator by proc 3 years, 9 months ago
  5. Slugify alternative by exogen 5 years, 1 month ago

Comments

(Forgotten your password?)