{ "info": { "author": "Andrei Lapets", "author_email": "a@lapets.io", "bugtrack_url": null, "classifiers": [], "description": "=====\nmr4mp\n=====\n\nThin MapReduce-like layer on top of the Python multiprocessing library.\n\n.. image:: https://badge.fury.io/py/mr4mp.svg\n :target: https://badge.fury.io/py/mr4mp\n :alt: PyPI version and link.\n\nPackage Installation and Usage\n------------------------------\nThe package is available on PyPI::\n\n python -m pip install mr4mp\n\nThe library can be imported in the usual way::\n\n import mr4mp\n\nExamples\n--------\n\nWord-Document Index\n~~~~~~~~~~~~~~~~~~~\n\nSuppose we have some functions that we can use to build an index of randomly generated words::\n\n def word(): # Generate a random 7-letter \"word\".\n return ''.join(choice(ascii_lowercase) for _ in range(7))\n \n def index(id): # Build an index mapping some random words to an identifier.\n return {w:{id} for w in {word() for _ in range(100)}}\n \n def merge(i, j): # Merge two index dictionaries i and j.\n return {k:(i.get(k,set()) | j.get(k,set())) for k in i.keys() | j.keys()}\n\nWe can then construct an index in the following way::\n\n start = timer()\n pool = mr4mp.pool()\n pool.mapreduce(index, merge, range(100))\n print(\"Finished in \" + str(timer()-start) + \"s using \" + str(len(pool)) + \" process(es).\")\n\nThe above might yield the following output::\n\n Finished in 0.664681524217187s using 2 process(es).\n\nSuppose we had instead explicitly specified that only one process can be used::\n\n pool = mr4mp.pool(1)\n\nAfter the above modification, we might see the following output from the code block::\n\n Finished in 2.23329004518571s using 1 process(es).\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lapets/mr4mp", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "mr4mp", "package_url": "https://pypi.org/project/mr4mp/", "platform": "", "project_url": "https://pypi.org/project/mr4mp/", "project_urls": { "Homepage": "https://github.com/lapets/mr4mp" }, "release_url": "https://pypi.org/project/mr4mp/0.0.4.0/", "requires_dist": null, "requires_python": "", "summary": "Thin MapReduce-like layer on top of the Python multiprocessing library.", "version": "0.0.4.0" }, "last_serial": 3519465, "releases": { "0.0.3.0": [ { "comment_text": "", "digests": { "md5": "f0fb3e463515e9e57daaa375c8fada91", "sha256": "75ca346ae55aa6e9f19ac4fdb1364b28698a577f2c52deb846e3ce3128697521" }, "downloads": -1, "filename": "mr4mp-0.0.3.0.tar.gz", "has_sig": false, "md5_digest": "f0fb3e463515e9e57daaa375c8fada91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2296, "upload_time": "2018-01-02T03:39:51", "url": "https://files.pythonhosted.org/packages/27/74/5e79a7d864613657aaba2df61d9b5886d8b7c15447979cfd62ed7288ee69/mr4mp-0.0.3.0.tar.gz" } ], "0.0.4.0": [ { "comment_text": "", "digests": { "md5": "de29885218b1b3d005793df8c68df00e", "sha256": "33429d37b75a22318d60fd0d2a00f1b6a4b7bcf46a7861cf57a072db217fee88" }, "downloads": -1, "filename": "mr4mp-0.0.4.0.tar.gz", "has_sig": false, "md5_digest": "de29885218b1b3d005793df8c68df00e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2280, "upload_time": "2018-01-25T06:23:03", "url": "https://files.pythonhosted.org/packages/eb/d8/c75084757d21c89b89b33768df1819e07557a21e52a4c20e6b96e7a0c4b7/mr4mp-0.0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de29885218b1b3d005793df8c68df00e", "sha256": "33429d37b75a22318d60fd0d2a00f1b6a4b7bcf46a7861cf57a072db217fee88" }, "downloads": -1, "filename": "mr4mp-0.0.4.0.tar.gz", "has_sig": false, "md5_digest": "de29885218b1b3d005793df8c68df00e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2280, "upload_time": "2018-01-25T06:23:03", "url": "https://files.pythonhosted.org/packages/eb/d8/c75084757d21c89b89b33768df1819e07557a21e52a4c20e6b96e7a0c4b7/mr4mp-0.0.4.0.tar.gz" } ] }