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.2.0.tar.gz
(3.3 kB
view details)
Built Distribution
mpfd-0.2.0-py3-none-any.whl
(3.5 kB
view details)
File details
Details for the file mpfd-0.2.0.tar.gz
.
File metadata
- Download URL: mpfd-0.2.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 | d542f73ff30f7b5077dcef21a273b97b3c1f4e243361ba1b4a83544e6849e91d |
|
MD5 | e4e37e8e2ca6efe786e6f0050ba6d745 |
|
BLAKE2b-256 | 4153afca56029049abd662ff753b5423a580083291db1c2b64a91d606d27a4d4 |
File details
Details for the file mpfd-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: mpfd-0.2.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 | 7f6465ae07db2223deca14e6015b1bf4d423502f35f4eb947ff2c344b0ffffd3 |
|
MD5 | 40d169cf3a81a50134f826015ee0a17e |
|
BLAKE2b-256 | 8427fd02e317d2de68bbe4e8b0aa3d0f642df4a6f04398fb8f3600a757476e4d |