Skip to content

module_ module

Utilities for modules.


package_shortcut_config HybridConfig

Config for package shortcuts.

HybridConfig(
    vbt='vectorbtpro',
    pd='pandas',
    np='numpy',
    nb='numba'
)

assert_can_import function

assert_can_import(
    pkg_name
)

Assert that a package can be imported.

Must be listed in opt_dep_config.


assert_can_import_any function

assert_can_import_any(
    *pkg_names
)

Assert that any from packages can be imported.

Must be listed in opt_dep_config.


check_installed function

check_installed(
    pkg_name
)

Check if a package is installed.


find_class function

find_class(
    path
)

Find the class by its path.


get_api_ref function

get_api_ref(
    obj,
    module=None,
    resolve=True
)

Get the API reference to an object.


get_imlucky_url function

get_imlucky_url(
    query
)

Get the "I'm lucky" URL on DuckDuckGo for a query.


get_installed_overview function

get_installed_overview()

Get an overview of installed packages in opt_dep_config.


get_method_class function

get_method_class(
    meth
)

Get the class of a method.


get_module function

get_module(
    obj
)

Get module of an object.


get_package_meta function

get_package_meta(
    pkg_name
)

Get metadata of a package.


get_refname function

get_refname(
    obj,
    module=None,
    resolve=True
)

Parse and (optionally) resolve the reference name of an object.


get_refname_module_and_qualname function

get_refname_module_and_qualname(
    refname,
    module=None
)

Get the module and the qualified name from a reference name.


imlucky function

imlucky(
    query,
    **kwargs
)

Open the "I'm lucky" URL on DuckDuckGo for a query.


import_module_from_path function

import_module_from_path(
    module_path,
    reload=False
)

Import the module from a path.


is_from_module function

is_from_module(
    obj,
    module
)

Return whether obj is from module module.


list_module_keys function

list_module_keys(
    module_or_name,
    whitelist=None,
    blacklist=None
)

List the names of all public functions and classes defined in the module module_name.

Includes the names listed in whitelist and excludes the names listed in blacklist.


open_api_ref function

open_api_ref(
    obj,
    module=None,
    resolve=True,
    **kwargs
)

Open the API reference to an object.


parse_refname function

parse_refname(
    obj
)

Get the reference name of an object.


resolve_refname function

resolve_refname(
    refname,
    module=None
)

Resolve a reference name.


search_package_for_funcs function

search_package_for_funcs(
    package,
    blacklist=None
)

Search a package for all functions.


warn_cannot_import function

warn_cannot_import(
    pkg_name
)

Warn if a package is cannot be imported.

Must be listed in opt_dep_config.