def extract_properties(self, dict_data, class_name):
        # items: current properties
        items = []
        # results: key = class_name, value = items
        results = {}
        # sub_model: sub model to be merged
        sub_model = {}

        class_name = self.trim_class_name(class_name)
        print('Generating "{}" file'.format(class_name))

        for original_name, value in dict_data.items():
            new_name = self._convert_name_style(original_name)

            if isinstance(value, dict):
                new_class_name = self.make_class_name(new_name)
                sub_model = self.extract_properties(value, new_class_name)
                results.update(sub_model)

                item = {
                    'name': new_name,
                    'original_name': original_name,
                    'storage': 'strong',
                    'class_name': new_class_name,
                    'transform': {
                        'type': 'Dictionary',
                        'class': new_class_name,
                    },
                }
            elif isinstance(value, list):
                new_class_name = self.make_class_name(new_name)
                if len(value) == 0:
                    print('WARNING: "{}" is not generated'.format(new_class_name))
                    continue
                if isinstance(value[0], dict):
                    sub_model = self.extract_properties(value[0], new_class_name)
                    results.update(sub_model)
                item = {
                    'name': new_name,
                    'original_name': original_name,
                    'storage': 'strong',
                    'class_name': 'NSArray',
                    'transform': {
                        'type': 'Array',
                        'class': new_class_name,
                    }
                }
            elif isinstance(value, self.str_type):
                item = {
                    'name': new_name,
                    'original_name': original_name,
                    'storage': 'copy',
                    'class_name': 'NSString',
                    'transform': None,
                }
            elif isinstance(value, int):
                item = {
                    'name': new_name,
                    'original_name': original_name,
                    'storage': 'assign',
                    'class_name': 'NSInteger',
                    'transform': None,
                }
            elif isinstance(value, bool):
                item = {
                    'name': new_name,
                    'original_name': original_name,
                    'storage': 'assign',
                    'class_name': 'BOOL',
                    'transform': None,
                }
            elif isinstance(value, float):
                item = {
                    'name': new_name,
                    'original_name': original_name,
                    'storage': 'assign',
                    'class_name': 'CGFloat',
                    'transform': None,
                }
            elif isinstance(value, types.NoneType):
                print('WARNING: "{}" is NULL'.format(original_name))
            else:
                raise ValueError(value)

            items.append(item)

        results[class_name] = items
        # reduce
        results.update(sub_model)
        return results
Extracts properties from a dictionary.
dataset/ETHPy150Open sutar/JSON2Mantle/JSON2Mantle/cli.py/JSON2Mantle.extract_properties