Name | para JSON |
Version |
0.0.8
JSON |
| download |
home_page | https://github.com/halfak/para |
Summary | a set utilities that ake advantage of python's 'multiprocessing' module to distribute CPU-intensive tasks |
upload_time | 2020-01-17 15:12:29 |
maintainer | |
docs_url | None |
author | Aaron Halfaker |
requires_python | |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Para(llel) processing utilities
This library implements a simple set of parallel processing utilities that
take advantage of python's `multiprocessing` module to distribute processing
over multiple CPUs on a single machine. The most salient feature of this
library is the **map()** function that can be used to distribute CPU-intensive
processing of a collection of items over multiple cores.
* **Installation** `pip install para`
## Basic usage
>>> import para
>>> import gzip
>>>
>>> items = ["examples/big-file1.gz", "examples/big-file2.gz",
... "examples/big-file3.gz"]
>>> def log_lines(path):
... with gzip.open(path, 'rt') as f:
... for lineno, line in enumerate(f):
... if len(line) > 50:
... yield path, lineno, line
...
>>> for path, lineno, line in para.map(log_lines, items):
... print(path, lineno, repr(line))
...
examples/big-file1.gz 2 'this line is going to be much longer than 80 chars -- at least I hope it will\n'
examples/big-file3.gz 0 'again with the long lines -- this is going to show up in the output, I hope\n'
## Authors
* Aaron Halfaker -- https://github.com/halfak
Raw data
{
"_id": null,
"home_page": "https://github.com/halfak/para",
"name": "para",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Aaron Halfaker",
"author_email": "aaron.halfaker@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a6/ac/192f715b8260eb05d7dfd822e9626583e2aa658f33afd407e2febbb37373/para-0.0.8.tar.gz",
"platform": "",
"description": "# Para(llel) processing utilities\nThis library implements a simple set of parallel processing utilities that\ntake advantage of python's `multiprocessing` module to distribute processing\nover multiple CPUs on a single machine. The most salient feature of this\nlibrary is the **map()** function that can be used to distribute CPU-intensive\nprocessing of a collection of items over multiple cores.\n\n* **Installation** `pip install para`\n\n## Basic usage\n\n >>> import para\n >>> import gzip\n >>>\n >>> items = [\"examples/big-file1.gz\", \"examples/big-file2.gz\",\n ... \"examples/big-file3.gz\"]\n >>> def log_lines(path):\n ... with gzip.open(path, 'rt') as f:\n ... for lineno, line in enumerate(f):\n ... if len(line) > 50:\n ... yield path, lineno, line\n ...\n >>> for path, lineno, line in para.map(log_lines, items):\n ... print(path, lineno, repr(line))\n ...\n examples/big-file1.gz 2 'this line is going to be much longer than 80 chars -- at least I hope it will\\n'\n examples/big-file3.gz 0 'again with the long lines -- this is going to show up in the output, I hope\\n'\n\n## Authors\n* Aaron Halfaker -- https://github.com/halfak\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "a set utilities that ake advantage of python's 'multiprocessing' module to distribute CPU-intensive tasks",
"version": "0.0.8",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "c84b59cc1c939029d9cb8ca4fc5cff30",
"sha256": "c63b030658cafd84f8fabfc000142324d51c7440e50ef5012fd1a54972ca25f4"
},
"downloads": -1,
"filename": "para-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c84b59cc1c939029d9cb8ca4fc5cff30",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6502,
"upload_time": "2020-01-17T15:12:28",
"upload_time_iso_8601": "2020-01-17T15:12:28.535498Z",
"url": "https://files.pythonhosted.org/packages/71/62/55f612856021efa8fe7425289914f3641cca7eb9bc9374bf888597f37ce7/para-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "4bda06e38cc2d7d865b2fb38e632605d",
"sha256": "46c3232ae9d8ea9d886cfd08cdd112892202bed8645f40b6255597ba4cfef217"
},
"downloads": -1,
"filename": "para-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "4bda06e38cc2d7d865b2fb38e632605d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5353,
"upload_time": "2020-01-17T15:12:29",
"upload_time_iso_8601": "2020-01-17T15:12:29.984371Z",
"url": "https://files.pythonhosted.org/packages/a6/ac/192f715b8260eb05d7dfd822e9626583e2aa658f33afd407e2febbb37373/para-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-01-17 15:12:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "halfak",
"github_project": "para",
"lcname": "para"
}