def test_search_module_noname(): pi.search(pi)
def test_examples(): pi.search(ex) # runs all of them
def test_search_class_args(): pi.search(Console, "search", print_table=False) pi.search(Console, "search", print_table=True) pi.search(Console, "search", include_parents=False) pi.search(Console, "search", include_parents=True)
def test_search_module(): pi.search(pi, "search")
def test_search_class(): pi.search(Console, "export")
def test_search_class_noname(): pi.search(Console)
def test_search_module_args(): pi.search(pi, "search", print_table=False) pi.search(pi, "search", print_table=True) pi.search(pi, "search", include_class=False) pi.search(pi, "search", include_class=True)
""" This tutorial shows how to use pyinspect.search to find a class' methods given a search string """ # import the class you need to inspect from rich.console import Console # import pyinspect import pyinspect as pi # find class methods pi.search(Console, "export") # use include_parents=False to skip parents
""" This tutorial shows how to use pyinspect.search to find a module's function given a search string. """ # import the module whose functions you're looking for import matplotlib.pyplot as plt # import matplotlib # import pyinspect import pyinspect as pi # Find the functions you're looking for pi.search(plt, name="subplot") # Or look for it in the entire package! # pi.search(matplotlib, name="subplot") """ Pro tip: omit the 'name' argument to find *all* functions Pro tip: pass 'include_class=False' to pi.search to ignore classes and only look for functions """
# import pyinspect import pyinspect as pi # Find the functions you're looking for pi.search(pi, name="what")
import pyinspect as pi pi.search(pi, "search") pi.showme(pi.find.search)