How to use the pdoc.Class function in pdoc

To help you get started, we’ve selected a few pdoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / google-cloud-python / scripts / generate_json_docs.py View on Github external
def from_pdoc(cls, element):
        is_class = isinstance(element, pdoc.Class)
        method = cls(element.refname, element.name, is_class)
        components = element.refname.split('.')

        mod = __import__(components[0])
        for comp in components[1:]:
            mod = getattr(mod, comp)

        # Get method line number.
        method.add_source_line(get_source_line_number(mod))

        # Get method Examples.
        examples = get_examples_from_docstring(element.docstring)
        if examples:
            method.add_example(examples)

        if element.docstring:
github googleapis / google-cloud-python-happybase / scripts / generate_json_docs.py View on Github external
    @classmethod
    def from_pdoc(cls, element):
        is_class = isinstance(element, pdoc.Class)
        method = cls(element.refname, element.name, is_class)
        components = element.refname.split('.')

        mod = __import__(components[0])

        for comp in components[1:]:
            mod = getattr(mod, comp)

        build_source(mod, method)

        if element.docstring:
            if not isinstance(element, pdoc.Class) and element.cls:
                cls = element.cls.cls
            elif element.cls:
                cls = element.cls
            else:
github scikit-optimize / scikit-optimize / build_tools / travis / make_doc.py View on Github external
def docfilter(o):
            rname = o.refname
            if rname.find(search) > -1 or search.find(o.name) > -1:
                return True
            if isinstance(o, pdoc.Class):
                return search in o.doc or search in o.doc_init
            return False

pdoc

API Documentation for Python Projects

MIT-0
Latest version published 28 days ago

Package Health Score

88 / 100
Full package analysis