# tools-mp
This Python library provides a convenient one-line multiprocessing option that can be used as follows:
```Python
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](https://pypi.org/project/tqdm/) library.
If workers=None (default) all available CPU cores will be used for processing.
# Installation
pip install tools-mp
Raw data
{
"_id": null,
"home_page": "https://github.com/paul-krug/tools-mp",
"name": "tools-mp",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "multiprocessing,Python",
"author": "Paul Krug",
"author_email": "paul_konstantin.krug@tu-dresden.de",
"download_url": "https://files.pythonhosted.org/packages/29/93/8d0d519cb39db660984e8a73cd04e6223096e4ec4dec6592cbb085fd591e/tools-mp-0.1.1.tar.gz",
"platform": null,
"description": "# tools-mp\r\n\r\nThis Python library provides a convenient one-line multiprocessing option that can be used as follows:\r\n\r\n```Python\r\nfrom tools_mp import multiprocess\r\n\r\ndef any_function( arg_1, arg_2, ..., arg_n ):\r\n\tdo something\r\n\treturn result\r\n\r\nargs = [ \r\n\t{\r\n\t\t'arg_1': arg_1,\r\n\t\t'arg_2': arg_2,\r\n\t\t...\r\n\t\t'arg_n': arg_n,\r\n\t\t} for arg_1, arg_2, ..., arg_n in arguments\r\n\t]\r\n\r\ndata = multiprocess(\r\n\tfunction = any_function,\r\n\targs = args,\r\n\treturn_data = True,\r\n\tverbose = True,\r\n\tworkers = 8,\r\n\t)\r\n```\r\n\r\nIf verbose=True, the progress of the calculation will be visualized via the [tqdm](https://pypi.org/project/tqdm/) library.\r\nIf workers=None (default) all available CPU cores will be used for processing.\r\n\r\n\r\n# Installation\r\n\r\n pip install tools-mp\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Convenient multiprocessing function for Python",
"version": "0.1.1",
"split_keywords": [
"multiprocessing",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "91da9633b4eee5e9d9668a0cc66e273b",
"sha256": "21a7b5104530a8c443d033f40dd2e22765ded0868759840e1d4321106e2764fb"
},
"downloads": -1,
"filename": "tools-mp-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "91da9633b4eee5e9d9668a0cc66e273b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3757,
"upload_time": "2022-12-01T13:23:15",
"upload_time_iso_8601": "2022-12-01T13:23:15.412822Z",
"url": "https://files.pythonhosted.org/packages/29/93/8d0d519cb39db660984e8a73cd04e6223096e4ec4dec6592cbb085fd591e/tools-mp-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-01 13:23:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "paul-krug",
"github_project": "tools-mp",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tools-mp"
}