Convenient multiprocessing function for Python
Project description
tools-mp
This Python library provides a convenient one-line multiprocessing option that can be used as follows:
from tools_mp import multiprocess
def any_function( arg_1, arg_2, ..., arg_n ):
do something
return result
args = [
{
'arg_1': arg_1,
'arg_2': arg_2,
...
'arg_n': arg_n,
} for arg_1, arg_2, ..., arg_n in arguments
]
data = multiprocess(
function = any_function,
args = args,
return_data = True,
verbose = True,
workers = 8,
)
If verbose=True, the progress of the calculation will be visualized via the tqdm library. If workers=None (default) all available CPU cores will be used for processing.
Installation
pip install tools-mp
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tools-mp-0.1.1.tar.gz
(3.8 kB
view hashes)