util_magic#

docstring style#

show_docstring_headers()

Show supported docstring header.

show_docstring_google()

Show google docstring style.

show_docstring_numpy()

Show numpy docstring style.

password_generator#

generate_password([pwd_len, lowercase, ...])

Generate a random password with given length and character types.

decorator - requires#

requires(*args, **kwargs)

Wrap a function with extra dependency checks.

decorator - func running time#

func_running_time(func)

A decorator to measure the time of a function or class method.

func_time(func)

A decorator to measure the time of a function or class method.

decorator - run parallel#

run_parallel(func, iterable[, ...])

Run a function in parallel with multiple processors.

decorator - end of life#

end_of_life([func_or_class])

A decorator to mark the end of life of a function or class method.

module import#

import_package(pkg_name[, options, verbose, ...])

Import a python package and optionally install it when it is missing.

get_active_python_env()

Return active Python environment information.

get_user_defined_func([module])

List all user-defined functions in a module.

get_user_defined_module(obj[, predicate])

Get only defined members.

get_user_imported_module(obj)

Get import members.

is_user_defined_func(func_obj)

Check if a function is user-defined.

is_module_importable(module_name)

Check whether a module is importable in the current Python environment.

count code lines#

count_lines_of_code(package_path, *[, ext, ...])

Counts the number of lines of code in a Python package.

time out function#

timeout(seconds)

A decorator to set the timeout for the function.

timeout_linux(timeout)

A decorator to set the timeout for the function on linux system.

Convert python file to dynamic linked library#

cvt_py_to_dll(py_file[, output_dir])

Convert a Python file to a DLL using Cython and setuptools.