tools-mp
This Python library provides a convenient one-line multiprocessing option that can be used as follows:
from tools_mp import multiprocess
from tools_mp import process
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,
**kwargs,
)
data = process(
function = any_function,
args = args,
return_data = True,
verbose = True,
workers = 8,
mp_threshold = 4, # <- if the number of tasks is less than this value,
# the process function will use single core processing, otherwise it
# will use multiprocessing. This can speed up the processing of small
# tasks significantly, as the overhead of multiprocessing is avoided.
**kwargs,
)
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. **kwargs will be passed to 'multiprocessing.Pool' as keyword arguments. This is important if you would like to initialize the workers with a specific function or variables for example.
Installation
pip install tools-mp
Metadata
Release files for tools-mp 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tools_mp-0.3.0.tar.gz | 3.8 kB | Without provenance | Details for tools_mp-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tools_mp-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for tools_mp-0.3.0-py3-none-any.whl |
Total release size: 7.7 kB
Release files / tools_mp-0.3.0.tar.gz
| Download URL | tools_mp-0.3.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b290e323d7eec362c9a8b8fe4c50c50d1d70dc9ca4d770e341297d38d834671
|
|
BLAKE2b-256 checksum How to use checksums |
8bb2b1070ec5a76e33166bb55b460692e362867f3b1c4e71103ffb44d80a87cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / tools_mp-0.3.0-py3-none-any.whl
| Download URL | tools_mp-0.3.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56831a5b6b5ab4b31da9bf6b3ed4cc301f1f8bbe30f08fca2e4777b9665b380d
|
|
BLAKE2b-256 checksum How to use checksums |
3378cccaa585db5f7debc2aa2b7d6747b621d2b61ed329b2b4b3e5a4d092def7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for tools-mp 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.