landlab.framework.decorators

Decorators for TheLandlab package.

camel_case(text, sep=None)[source]

Convert to camel case.

Convert text to camel case. Use the sep keyword to specify the word separator. The default is to split on whitespace.

>>> from landlab.framework.decorators import camel_case
>>> camel_case("eric idle")
'EricIdle'
>>> camel_case("terry_gilliam", sep="_")
'TerryGilliam'
>>> camel_case("MONTY Python")
'MONTYPython'
>>> camel_case("GrahamChapman")
'GrahamChapman'
snake_case(text)[source]

Convert camel case to snake case.

Examples

>>> from landlab.framework.decorators import snake_case
>>> snake_case("EricIdle")
'eric_idle'
>>> snake_case("MONTYPython")
'monty_python'