(self, data, options=None, **kwargs)
Create a class from the passed in data

        :param data: dictionary data of parser output
Create a class from the passed in data
Create a class from the passed in data
def create_class(self, data, options=None, **kwargs):
        """Create a class from the passed in data

        :param data: dictionary data of parser output
        """
        try:
            cls = self._OBJ_MAP[data["type"]]
        except KeyError:
            # this warning intentionally has no (sub-)type
            LOGGER.warning("Unknown type: %s" % data["type"])
        else:
            obj = cls(
                data,
                class_content=self.app.config.autoapi_python_class_content,
                options=self.app.config.autoapi_options,
                jinja_env=self.jinja_env,
                app=self.app,
                **kwargs,
            )
            obj.url_root = self.url_root

            for child_data in data.get("children", []):
                for child_obj in self.create_class(
                    child_data, options=options, **kwargs
                ):
                    obj.children.append(child_obj)

            # Some objects require children to establish their docstring
            # or type annotations (eg classes with inheritance),
            # so do this after all children have been created.
            lines = obj.docstring.splitlines()
            lines.append("")  # Add back the trailing newline that .splitlines removes
            if lines and "autodoc-process-docstring" in self.app.events.events:
                self.app.emit(
                    "autodoc-process-docstring", cls.type, obj.name, None, None, lines
                )
            obj.docstring = "\n".join(lines)
            self._record_typehints(obj)

            # Parser gives children in source order already
            if self.app.config.autoapi_member_order == "alphabetical":
                obj.children.sort(key=operator.attrgetter("name"))
            elif self.app.config.autoapi_member_order == "groupwise":
                obj.children.sort(key=lambda x: (x.member_order, x.name))

            yield obj
def create_class ( self , data , options = None , * * kwargs ) : try : cls = self . _OBJ_MAP [ data [ "type" ] ] except KeyError : # this warning intentionally has no (sub-)type LOGGER . warning ( "Unknown type: %s" % data [ "type" ] ) else : obj = cls ( data , class_content = self . app . config . autoapi_python_class_content , options = self . app . config . autoapi_options , jinja_env = self . jinja_env , app = self . app , * * kwargs , ) obj . url_root = self . url_root for child_data in data . get ( "children" , [ ] ) : for child_obj in self . create_class ( child_data , options = options , * * kwargs ) : obj . children . append ( child_obj ) # Some objects require children to establish their docstring # or type annotations (eg classes with inheritance), # so do this after all children have been created. lines = obj . docstring . splitlines ( ) lines . append ( "" ) # Add back the trailing newline that .splitlines removes if lines and "autodoc-process-docstring" in self . app . events . events : self . app . emit ( "autodoc-process-docstring" , cls . type , obj . name , None , None , lines ) obj . docstring = "\n" . join ( lines ) self . _record_typehints ( obj ) # Parser gives children in source order already if self . app . config . autoapi_member_order == "alphabetical" : obj . children . sort ( key = operator . attrgetter ( "name" ) ) elif self . app . config . autoapi_member_order == "groupwise" : obj . children . sort ( key = lambda x : ( x . member_order , x . name ) ) yield obj