pyufunc.pkg_public_func#
- pyufunc.pkg_public_func(pkg_name, *, import_name=None, verbose=True)#
Show package-level public functions defined by a Python package.
The function first inspects the package in the current Python environment. If the package cannot be imported, it downloads the latest distribution from PyPI into a temporary directory and statically inspects the package source. Downloaded distributions are not installed.
- Parameters:
pkg_name – Package import name or PyPI distribution name. For packages whose distribution name differs from the import name, pass the PyPI name here and set
import_namewhen needed.import_name – Optional import/package name override. For example,
pkg_public_func("python-dateutil", import_name="dateutil").verbose – Whether to print fallback errors. Defaults to True.
Note
Source package:
pyufunc.Source repository: xyluo25/pyufunc
Source document: https://pyufunc.readthedocs.io/en/latest/
Source license: MIT License.
Downloaded PyPI distributions are inspected in a temporary directory and are not installed.
Example
>>> from pyufunc import pkg_public_func >>> public_funcs = pkg_public_func("pyufunc.util_img") >>> "img_to_bytes" in public_funcs True
>>> pkg_public_func("python-dateutil", import_name="dateutil")