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.3.0.tar.gz
(3.3 kB
view details)
Built Distribution
mpfd-0.3.0-py3-none-any.whl
(3.5 kB
view details)
File details
Details for the file mpfd-0.3.0.tar.gz
.
File metadata
- Download URL: mpfd-0.3.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 | 5c844cb2b6244c1c8c4c80a4b69353bad10986526a01667a066923d121f266c0 |
|
MD5 | e6ce533e07fc4570a9e0a8f92aeb2542 |
|
BLAKE2b-256 | 01dfa58af0610b8ef596d4dcfd796580b76f0067686a06207e69ae2d21b96d25 |
File details
Details for the file mpfd-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: mpfd-0.3.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 | 00904bf75f77f87255532c0df10d6aebbdc8b5b06fa3c4aa89d717cf6672f5de |
|
MD5 | 7f33b12d118f0e92063f706bf715055f |
|
BLAKE2b-256 | fa231322ca8fc64ef15c955ca71991bea2c62c6fa67f8460dd12edcda124a5cd |