{ "info": { "author": "Grigory Bakunov", "author_email": "thebobuk@ya.ru", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# uparallel\n\u03bcparallel - oversimplified helper for easy parallel functions execution\n\nYes, it's oversimplified:\n\n```python\nfrom uparallel import uparallel\nimport requests\n\n@uparallel(3)\ndef wikipedia(word):\n return requests.get(f\"https://www.wikiwand.com/en/{word.capitalize()}\")\n\nresults = [wikipedia(word) for word in 'fork spoon spork knife cup home'.split()]\nfor line in results:\n print(line.url, line.status_code)\n```\n\nSo, `unparallel(num)` is a wrapper for any function to execute `num` of them in parallel.\nThere's three limitations:\n\n1. It will wait until last of calls finish their execution\n2. It will break on any execption, so catch it inside the function\n3. Returned result is a thin wrapper, not result of function itself.\n\nLast one need more explanation. Instead of result of function you will got a special proxy object. It will behave more or less like your normal object (like in this example with `requests`). If it's not, call `result.wait()` or even just `result()` instead of just `result`.\n\n```python\n@uparallel(2)\ndef add2(x):\n return x+2\n\t\nresults = [add2(x) for x in range(10)]\nfor y in results:\n\tprint(y()-2, y)\n```\n\nAnd don't afread to read the code, it's less than 100 lines long.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/bobuk/uparallel", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "uparallel", "package_url": "https://pypi.org/project/uparallel/", "platform": "", "project_url": "https://pypi.org/project/uparallel/", "project_urls": { "Homepage": "http://github.com/bobuk/uparallel" }, "release_url": "https://pypi.org/project/uparallel/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "uparallel - oversimplified helper for easy parallel functions execution ", "version": "0.1.0" }, "last_serial": 4037659, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2777cb9457e2b8968c77d3d93c8f9c08", "sha256": "58ded0854b87870a01d37e24b265de4416c3b6e44e01671f3a8251c912094ceb" }, "downloads": -1, "filename": "uparallel-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2777cb9457e2b8968c77d3d93c8f9c08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2098, "upload_time": "2018-07-06T20:56:48", "url": "https://files.pythonhosted.org/packages/a3/b9/9ab751547fedfb849da32d30292f95633b4797c932d214ee34f7a8e8a8f7/uparallel-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2777cb9457e2b8968c77d3d93c8f9c08", "sha256": "58ded0854b87870a01d37e24b265de4416c3b6e44e01671f3a8251c912094ceb" }, "downloads": -1, "filename": "uparallel-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2777cb9457e2b8968c77d3d93c8f9c08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2098, "upload_time": "2018-07-06T20:56:48", "url": "https://files.pythonhosted.org/packages/a3/b9/9ab751547fedfb849da32d30292f95633b4797c932d214ee34f7a8e8a8f7/uparallel-0.1.0.tar.gz" } ] }