Skip to main content

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.5.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

mpfd-0.5.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file mpfd-0.5.0.tar.gz.

File metadata

  • Download URL: mpfd-0.5.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

Hashes for mpfd-0.5.0.tar.gz
Algorithm Hash digest
SHA256 cf9af692f469ae5617a51c16229e999a41649612c978e1d5afb6ccd8bcca59f1
MD5 78af3bd09adad318b4beb064307b2939
BLAKE2b-256 e092ce9640d56be144b44a8099bb84dd3489d464f54390e3df388e66f6e8aba9

See more details on using hashes here.

File details

Details for the file mpfd-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: mpfd-0.5.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

Hashes for mpfd-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 faf4c513670827e2e05a27d7fdd69176f4523bfe4a64ba001c39ebfd68f3d192
MD5 fa56804cc3b47f4895573f815257f7b3
BLAKE2b-256 17a7950057abaa2b573d165a72dce1016209015ec5295649b665e9e85966008f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page