API

Main

This module contains all the core logic for humps.

humps.main.camelize(str_or_iter)[source]

Convert a string, dict, or list of dicts to camel case.

Parameters:str_or_iter (Union[list, dict, str]) – A string or iterable.
Return type:Union[list, dict, str]
Returns:camelized string, dictionary, or list of dictionaries.
humps.main.decamelize(str_or_iter)[source]

Convert a string, dict, or list of dicts to snake case.

Parameters:str_or_iter (Union[list, dict, str]) – A string or iterable.
Return type:Union[list, dict, str]
Returns:snake cased string, dictionary, or list of dictionaries.
humps.main.depascalize(str_or_iter)[source]

Convert a string, dict, or list of dicts to snake case.

Parameters:str_or_iter (Union[list, dict, str]) – A string or iterable.
Return type:Union[list, dict, str]
Returns:snake cased string, dictionary, or list of dictionaries.
humps.main.is_camelcase(str_or_iter)[source]

Determine if a string, dict, or list of dicts is camel case.

Parameters:str_or_iter (Union[list, dict, str]) – A string or iterable.
Return type:bool
Returns:True/False whether string or iterable is camel case
humps.main.is_pascalcase(str_or_iter)[source]

Determine if a string, dict, or list of dicts is pascal case.

Parameters:str_or_iter (Union[list, dict, str]) – A string or iterable.
Return type:bool
Returns:True/False whether string or iterable is pascal case
humps.main.is_snakecase(str_or_iter)[source]

Determine if a string, dict, or list of dicts is snake case.

Parameters:str_or_iter (Union[list, dict, str]) – A string or iterable.
Return type:bool
Returns:True/False whether string or iterable is snake case
humps.main.pascalize(str_or_iter)[source]

Convert a string, dict, or list of dicts to pascal case.

Parameters:str_or_iter (Union[list, dict, str]) – A string or iterable.
Return type:Union[list, dict, str]
Returns:pascalized string, dictionary, or list of dictionaries.
humps.main.separate_words(string, separator='_')[source]

Split words that are separated by case differentiation. :param string: Original string. :param separator: String by which the individual

words will be put back together.
Returns:New string.