Package to simplify process of parallelising tasks
Project description
parallelize
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 | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyparallelize-0.1.0.tar.gz.
File metadata
- Download URL: pyparallelize-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.25.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a2e4195fde08af9de89511516bce3d7193d16c78388a1eed8b6f6c85e5929e1
|
|
| MD5 |
2f40578edb848684ad4e76fac8bb13af
|
|
| BLAKE2b-256 |
53561abfc63f78719372103619f51b8269513294a4bcb54b2726b6281e718848
|
File details
Details for the file pyparallelize-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyparallelize-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.25.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d5502f587a9b1d3bbd629626a5db0312189a835c0667c5345c003dfdbd6ae70
|
|
| MD5 |
7941f79e8dc072eb231bcb40d4b53fa5
|
|
| BLAKE2b-256 |
cdb51fb39428fade37089774b96dd4cd03d23bdeefdae460f9b29a88ce095014
|