{ "info": { "author": "Giuseppe Tribulato", "author_email": "gtsystem@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "parallelpipe\n============\n\n|Build Status|\n\nparallelpipe is a pipeline parallelization library for Python.\n\nA pipeline is composed by one or more stages. Each stage take the output\nof the previous stage as an input and performs some operations on it\nlike map, filter, reduce, etc. This is an extension of the normal\nproducer/consumer pattern where we can have multiple stages. Every stage\nreceives the input data in a queue and push the results to another queue\nthat is connected with the next stage.\n\n \n\nIn this example we define a stage function that takes as an input an\niterator returning urls and return the corresponding content after\ndownloading it:\n\n.. code:: python\n\n from parallelpipe import stage\n import requests\n \n @stage(workers=4)\n def fetch_urls(urls):\n for url in urls:\n result = requests.get(url)\n yield result.content\n\nTo use this stage just run\n\n.. code:: python\n\n urls = ['http://test.com', ...]\n pipe = urls | fetch_urls\n for content in pipe.results():\n print(len(content))\n\nWe built a basic pipe with only one stage. This stage have 4 workers\nthat will start processing in parallel the input urls. The main process\nwill receive the downloaded content as soon as one of them is available\nand print the corresponding length. Notice that a pipeline input can be\nany iterable; this will be automatically wrapped into a stage.\n\nLet's say we are interested into the title string inside the HTML\ncontent. We can add another stage to do that:\n\n.. code:: python\n\n import re\n RE_TITLE = re.compile(\"