Did I find the right examples for you? yes no

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
Converts all the keys in a dict to camelcase. It works recursively to convert any nested dicts as well.
@param data: The dict to convert

        def underscore_keys(data):
    """
    Converts all the keys in a dict to camelcase. It works recursively to convert any nested dicts as well.
    @param data: The dict to convert
    """
    return_dict = {}
    for key in data:
        if isinstance(data[key], dict):
            return_dict[camelcase_to_underscore(key)] = underscore_keys(data[key])
        else:
            return_dict[camelcase_to_underscore(key)] = data[key]

    return return_dict
        


src/p/y/PyBambooHR-0.3.1/PyBambooHR/PyBambooHR.py   PyBambooHR(Download)
import requests
 
from utils import camelcase_keys, underscore_keys, underscore_to_camelcase
 
class PyBambooHR(object):
        employees = data['employees']
        if self.underscore_keys:
            employees = [underscore_keys(employee) for employee in employees]
 
        return employees
 
        if self.underscore_keys:
            employee = underscore_keys(employee)
 
        return employee