A decorator that makes a function into a parallel processor using multithreading.
Project description
mpfd - Make Parallel Function Decorator
mpfd is a simple Python package that provides a decorator, make_parallel, which allows you to make a function run in parallel using multithreading. This is built on top of Python's concurrent.futures module.
Installation
Install the package via pip :
pip install mpfd
Usage
To use the make_parallel decorator :
from mpfd import make_parallel
@make_parallel
def my_function(param):
print(param)
my_function(
[
"Hello, parallel world!1",
"Hello, parallel world!2",
"Hello, parallel world!3",
"Hello, parallel world!4",
"Hello, parallel world!5",
"Hello, parallel world!6",
"Hello, parallel world!7",
"Hello, parallel world!8",
"Hello, parallel world!9",
"Hello, parallel world!10"
]
)
This will execute my_function in parallel using multithreading.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpfd-0.6.0.tar.gz.
File metadata
- Download URL: mpfd-0.6.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0946e727147e1342df3fa0730a11b16a42b412b352a33bde938a672f99c0774d
|
|
| MD5 |
55cb76659db0707d137f604425eabd6d
|
|
| BLAKE2b-256 |
c30e02378b53e36ba0f80d0228991cb2bc510d60e5a7cba373e45c5eab481917
|
File details
Details for the file mpfd-0.6.0-py3-none-any.whl.
File metadata
- Download URL: mpfd-0.6.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
303a8958cdfa1bc50afe7fb95e97f3a283fcf5254a8c698e86f63de504e64e2b
|
|
| MD5 |
d3ff806a9235c2f201efe3ce21fbab9a
|
|
| BLAKE2b-256 |
7cb2f6cb0f9834cd52bb3d006909dc8374a352150750355916b2cdb6f0ec7468
|