Skip to main content

A collection of patterns to use over top of the built in multiprocessing package

Reason this release was yanked:

bug in transform_init

Project description

mp_boilerplate

A collection of patterns to use over top of the built in multiprocessing package.

Install

pip install mp_boilerplate

Use Case: (E)xtract (P)arallel (T)ransform (S)ave

The extract parallel transform save (EPTS) use case is as follows:

  • A producer(single)/consumer(multiple) that applies a transform
  • A producer(multiple)/consumer(single) that saves the transform

This usually means: read a file/folder, do something to each item, save the result.

import mp_boilerplate as mpb
import typing as t
from typeguard import typechecked

def extract() -> t.Iterator:
    for i in range(100):
        yield i
def transform(i):
    return i + 1
def save(items: t.Iterator):
    for item in items:
        print(item)

if __name__ == '__main__':
    worker = mpb.EPTS(extract, transform, save)
    worker.start()
    worker.join()

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

mp_boilerplate-0.3.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

mp_boilerplate-0.3.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file mp_boilerplate-0.3.2.tar.gz.

File metadata

  • Download URL: mp_boilerplate-0.3.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for mp_boilerplate-0.3.2.tar.gz
Algorithm Hash digest
SHA256 b131d79d1a6b8b477440d57424cea375f9ecc43a7c00ed7d90963d2ce1b5ada2
MD5 cd507d40d4f3847a09c2693cbd3fb5ae
BLAKE2b-256 5348d1cd16997935297383ef6982848350f2e1f81c5d78f869eeed6798c4ad50

See more details on using hashes here.

Provenance

File details

Details for the file mp_boilerplate-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: mp_boilerplate-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for mp_boilerplate-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 158d545d1251e2afb8aef8345c8fd54cf65ef42c08cd6e6eb3078e608688900c
MD5 c26584e29e8ed501e247a847ef5bb7b7
BLAKE2b-256 9d94745104c5d844c06123ec8e9d604f321337c0e7547e38e4ac50d192f0428a

See more details on using hashes here.

Provenance

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