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",
]
)
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
mpfd-0.4.0.tar.gz
(3.3 kB
view details)
Built Distribution
mpfd-0.4.0-py3-none-any.whl
(3.5 kB
view details)
File details
Details for the file mpfd-0.4.0.tar.gz
.
File metadata
- Download URL: mpfd-0.4.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 484fade3c4fe85553c121893cdfe0137c8372468333df5afd9d8ec4959b8e220 |
|
MD5 | 439fb6bc0766454cbd827af75ee688cd |
|
BLAKE2b-256 | fef999476fe1f4f850b137b965591b93882a8f554374d1b2d3904bdc2a1ab4f9 |
File details
Details for the file mpfd-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: mpfd-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.5 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 | 2c9413afd22906c7249076c9c936f253af86b8cd97888b8abb1a8daf8f58ee9f |
|
MD5 | 2451da7554813bdb8e4ba46b22f1208b |
|
BLAKE2b-256 | 4656b76b87018de589eb537a619c0ea56da399c4eb415622e713bb46a7abb74b |