package documentation

Package for retrieving data from typeshed.

Module finder This module is responsible for finding stub files.
Module parser This module is responsible for parsing a stub AST into a dictionary of names.
Module resolver Module responsible for resolving names to the module they come from.

From __init__.py:

Class ImportedInfo Undocumented
Class ImportedName Undocumented
Class NameInfo Undocumented
Class OverloadedName Undocumented
Class Resolver No class docstring; 0/2 instance variable, 1/4 method documented
Class SearchContext Undocumented
Function get_all_stub_files Return paths to all stub files for a given Python version.
Function get_search_context Return a context for finding stubs. This context can be passed to other functions in this file.
Function get_stub_ast Return the AST for the stub for the given module name.
Function get_stub_file Return the path to the stub file for this module, if any.
Function get_stub_names Given a module name, return a dictionary of names defined in that module.
Function parse_ast Undocumented
Type Alias NameDict Undocumented
Variable __version__ Undocumented
Variable ModulePath Undocumented
def get_stub_ast(module_name: str, *, search_context: Optional[SearchContext] = None) -> Optional[ast.AST]: (source)

Return the AST for the stub for the given module name.

def get_stub_file(module_name: str, *, search_context: Optional[SearchContext] = None) -> Optional[Path]: (source)

Return the path to the stub file for this module, if any.

def get_all_stub_files(search_context: Optional[SearchContext] = None) -> Iterable[Tuple[str, Path]]: (source)

Return paths to all stub files for a given Python version. Return pairs of (module name, module path).

def get_search_context(*, typeshed: Optional[Path] = None, search_path: Optional[Sequence[Path]] = None, python_executable: Optional[str] = None, version: Optional[PythonVersion] = None, platform: str = sys.platform, raise_on_warnings: bool = False) -> SearchContext: (source)

Return a context for finding stubs. This context can be passed to other functions in this file. Arguments: - typeshed: Path to typeshed. If this is not given, typeshed_client's own bundled copy of typeshed is used. - search_path: Sequence of directories in which to search for stubs. If this is not given, ``sys.path`` is used. - python_executable: Path to a Python executable that should be used to find the search_path. The default is to use ``sys.executable``. - version: Version of Python to use, as a two-tuple like (3, 9). - platform: Value to use for sys.platform in stubs, defaulting to the current process's value. - raise_on_warnings: Raise an error for any warnings encountered by the parser.

ModulePath = (source)

Undocumented

def get_stub_names(module_name: str, *, search_context: Optional[SearchContext] = None) -> Optional[NameDict]: (source)

Given a module name, return a dictionary of names defined in that module.

def parse_ast(ast: ast.AST, search_context: SearchContext, module_name: ModulePath, *, is_init: bool = False) -> NameDict: (source)

Undocumented

NameDict = (source)

Undocumented

Value
Dict[str, NameInfo]
__version__: str = (source)

Undocumented