from typing import List
from typing import Callable
import inspect


def find_scrapers(module) -> List[Callable]:
    """
    Build a list of 'scraper' functions contained in a module.
    These consist of every function public function (i.e., does not begin with_)
    that is defined, but not imported, in the module

    :param module: Module containing local
    :return: List of scraper functions, each of which returns a List of Event dicts
    """

    def predicate(event):
        return inspect.isfunction(event) and inspect.getmodule(event) == module

    scrapers = inspect.getmembers(module, predicate)
    return [s[1] for s in scrapers if not s[0].startswith('_')]