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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpfd-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 af618d2a81d3788bce6a091ac329123eefbf88edd2cab05b4ad0102d03c716ea
MD5 43fa4715a9666a346d6b338394022235
BLAKE2b-256 07724e72e3dbba7971c511000b7a35987ffbc9cbe37bda2b914f092d73c6374f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mpfd-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c711fd85e8c99891acbd1e37a04337927a396b9ae1e8630429705700d6750a76
MD5 46ca8126259f90ab1590c9482657ee38
BLAKE2b-256 c86f10d9c0e6a06b64f5b8ace9fd0adf441f50f73d4616932d2f9751f172a0fb

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