Skip to main content

Package to simplify process of parallelising tasks

Project description

parallelize

Documentation Status AUR CircleCI

parallelize is a Python package to simplify the process of parallelising your taks in Python. It takes advantage of the multiprocessing module to spawn new processes for your job.

Requirements

  • Python 3.X

Installation

To install parallelize, you can either install from the source code or using pip.

To install from source code, first clone the repository. Then, run python setup.py install in the root directory.

Documentation

To build the documentation, run make html inside the docs/ folder. The documention will be found in the docs/build/html directory. Alternatively, view documentation here.

Usage

To parallelise a task in Python, you should wrap the entire code inside a function and have the first argument of your function receive the iterable your function will be operating over.

>>> from parallelize import parallelize
>>> def foo(iterable: list) -> int:
...    output = 0
...    for i in iterable:
...        output = i**4
...    return output

>>> numbers = list(range(50000000))
>>> %time foo(numbers)
Wall time: 21.5 s
>>> parallelize.parallel(foo, numbers, 6)
Completed 'parallel' in 6.2743 secs

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyparallelize, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pyparallelize-0.1.0-py3-none-any.whl (5.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyparallelize-0.1.0.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page