{ "info": { "author": "Vincent Michel", "author_email": "vxgmichel@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "aiostream\n=========\n\n\n.. image:: https://readthedocs.org/projects/aiostream/badge/?version=latest\n :target: http://aiostream.readthedocs.io/en/latest/?badge=latest\n :alt:\n\n.. image:: https://coveralls.io/repos/github/vxgmichel/aiostream/badge.svg?branch=master\n :target: https://coveralls.io/github/vxgmichel/aiostream?branch=master\n :alt:\n\n.. image:: https://travis-ci.org/vxgmichel/aiostream.svg?branch=master\n :target: https://travis-ci.org/vxgmichel/aiostream\n :alt:\n\n.. image:: https://img.shields.io/pypi/v/aiostream.svg\n :target: https://pypi.python.org/pypi/aiostream\n :alt:\n\n.. image:: https://img.shields.io/pypi/pyversions/aiostream.svg\n :target: https://pypi.python.org/pypi/aiostream/\n :alt:\n\nGenerator-based operators for asynchronous iteration\n\n\nSynopsis\n--------\n\naiostream_ provides a collection of stream operators that can be combined to create\nasynchronous pipelines of operations.\n\nIt can be seen as an asynchronous version of itertools_, although some aspects are slightly different.\nEssentially, all the provided operators return a unified interface called a stream.\nA stream is an enhanced asynchronous iterable providing the following features:\n\n- **Operator pipe-lining** - using pipe symbol ``|``\n- **Repeatability** - every iteration creates a different iterator\n- **Safe iteration context** - using ``async with`` and the ``stream`` method\n- **Simplified execution** - get the last element from a stream using ``await``\n- **Slicing and indexing** - using square brackets ``[]``\n- **Concatenation** - using addition symbol ``+``\n\n\nRequirements\n------------\n\nThe stream operators rely heavily on asynchronous generators (`PEP 525`_):\n\n- python >= 3.6\n\n\nStream operators\n----------------\n\nThe `stream operators`_ are separated in 7 categories:\n\n+--------------------+---------------------------------------------------------------------------------------+\n| **creation** | iterate_, preserve_, just_, call_, empty_, throw_, never_, repeat_, count_, range_ |\n+--------------------+---------------------------------------------------------------------------------------+\n| **transformation** | map_, enumerate_, starmap_, cycle_, chunks_ |\n+--------------------+---------------------------------------------------------------------------------------+\n| **selection** | take_, takelast_, skip_, skiplast_, getitem_, filter_, until_, takewhile_, dropwhile_ |\n+--------------------+---------------------------------------------------------------------------------------+\n| **combination** | map_, zip_, merge_, chain_, ziplatest_ |\n+--------------------+---------------------------------------------------------------------------------------+\n| **aggregation** | accumulate_, reduce_, list_ |\n+--------------------+---------------------------------------------------------------------------------------+\n| **advanced** | concat_, flatten_, switch_, concatmap_, flatmap_, switchmap_ |\n+--------------------+---------------------------------------------------------------------------------------+\n| **timing** | spaceout_, timeout_, delay_ |\n+--------------------+---------------------------------------------------------------------------------------+\n| **miscellaneous** | action_, print_ |\n+--------------------+---------------------------------------------------------------------------------------+\n\n\nDemonstration\n-------------\n\nThe following example demonstrates most of the streams capabilities:\n\n.. sourcecode:: python\n\n import asyncio\n from aiostream import stream, pipe\n\n\n async def main():\n\n # Create a counting stream with a 0.2 seconds interval\n xs = stream.count(interval=0.2)\n\n # Operators can be piped using '|'\n ys = xs | pipe.map(lambda x: x**2)\n\n # Streams can be sliced\n zs = ys[1:10:2]\n\n # Use a stream context for proper resource management\n async with zs.stream() as streamer:\n\n # Asynchronous iteration\n async for z in streamer:\n\n # Print 1, 9, 25, 49 and 81\n print('->', z)\n\n # Streams can be awaited and return the last value\n print('9\u00b2 = ', await zs)\n\n # Streams can run several times\n print('9\u00b2 = ', await zs)\n\n # Streams can be concatenated\n one_two_three = stream.just(1) + stream.range(2, 4)\n\n # Print [1, 2, 3]\n print(await stream.list(one_two_three))\n\n\n # Run main coroutine\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main())\n loop.close()\n\nMore examples are available in the `example section`_ of the documentation.\n\n\nContact\n-------\n\nVincent Michel: vxgmichel@gmail.com\n\n\n.. _aiostream: https://github.com/vxgmichel/aiostream\n.. _PEP 525: http://www.python.org/dev/peps/pep-0525/\n.. _Rx: http://reactivex.io/\n.. _aioreactive: http://github.com/dbrattli/aioreactive\n.. _itertools: http://docs.python.org/3/library/itertools.html\n\n.. _stream operators: http://aiostream.readthedocs.io/en/latest/operators.html\n.. _example section: http://aiostream.readthedocs.io/en/latest/examples.html\n\n.. _iterate: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.iterate\n.. _preserve: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.preserve\n.. _just: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.just\n.. _call: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.call\n.. _throw: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.throw\n.. _empty: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.empty\n.. _never: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.never\n.. _repeat: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.repeat\n.. _range: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.range\n.. _count: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.count\n\n.. _map: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.map\n.. _enumerate: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.enumerate\n.. _starmap: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.starmap\n.. _cycle: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.cycle\n.. _chunks: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.chunks\n\n.. _take: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.take\n.. _takelast: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.takelast\n.. _skip: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.skip\n.. _skiplast: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.skiplast\n.. _getitem: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.getitem\n.. _filter: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.filter\n.. _until: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.until\n.. _takewhile: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.takewhile\n.. _dropwhile: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.dropwhile\n\n.. _chain: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.chain\n.. _zip: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.zip\n.. _merge: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.merge\n.. _ziplatest: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.ziplatest\n\n.. _accumulate: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.accumulate\n.. _reduce: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.reduce\n.. _list: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.list\n\n.. _concat: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.concat\n.. _flatten: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.flatten\n.. _switch: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.switch\n.. _concatmap: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.concatmap\n.. _flatmap: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.flatmap\n.. _switchmap: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.switchmap\n\n.. _spaceout: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.spaceout\n.. _delay: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.delay\n.. _timeout: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.timeout\n\n.. _action: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.action\n.. _print: http://aiostream.readthedocs.io/en/latest/operators.html#aiostream.stream.print", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vxgmichel/aiostream", "keywords": "", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "aiostream", "package_url": "https://pypi.org/project/aiostream/", "platform": "", "project_url": "https://pypi.org/project/aiostream/", "project_urls": { "Homepage": "https://github.com/vxgmichel/aiostream" }, "release_url": "https://pypi.org/project/aiostream/0.4.0/", "requires_dist": null, "requires_python": "", "summary": "Generator-based operators for asynchronous iteration", "version": "0.4.0" }, "last_serial": 5928560, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "eeaaf10843b5eaae7e9bd6d11d6389a3", "sha256": "879bcd591f553b4205133fcf7e01baa58cc8dfb31284a067e0dbd37c57a7f8b2" }, "downloads": -1, "filename": "aiostream-0.1.1.tar.gz", "has_sig": false, "md5_digest": "eeaaf10843b5eaae7e9bd6d11d6389a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10035, "upload_time": "2016-11-02T17:31:52", "url": "https://files.pythonhosted.org/packages/2a/aa/87234bb12be107bb0eaae99f70b15209881bce35646eceff1c2083f3ec64/aiostream-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "9c2e51323063208dfac856a6254a5f7d", "sha256": "27e30496bdbd4997cc1d83223cb0a573710111b55ef47e6068f82509d97281f0" }, "downloads": -1, "filename": "aiostream-0.2.0.tar.gz", "has_sig": false, "md5_digest": "9c2e51323063208dfac856a6254a5f7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16155, "upload_time": "2016-11-10T16:16:31", "url": "https://files.pythonhosted.org/packages/cd/8a/809e21233ac84da378f679a7e80079a8f56a68bbb404992a28c48cee8147/aiostream-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "c0535929f4824b40bec149c2c5c55e4d", "sha256": "108c553db77f3543418abbcef1c1bda4d9b8026f73c185200d7bdfdac1d67b48" }, "downloads": -1, "filename": "aiostream-0.2.1.tar.gz", "has_sig": false, "md5_digest": "c0535929f4824b40bec149c2c5c55e4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16025, "upload_time": "2016-11-11T15:36:41", "url": "https://files.pythonhosted.org/packages/f0/86/16e9037ca6c887231dcfdb35d2fd7c8ef293b2bad7dda9de011d3b434443/aiostream-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "b2cc99b68c1c278f8c26355c0d4468b2", "sha256": "b43b70ed66258fc67ac47e1557229fdbd3076895aa26ae7f8f26b4bf47417c77" }, "downloads": -1, "filename": "aiostream-0.2.2.tar.gz", "has_sig": false, "md5_digest": "b2cc99b68c1c278f8c26355c0d4468b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14888, "upload_time": "2016-11-20T15:11:06", "url": "https://files.pythonhosted.org/packages/55/83/f90c4c3d9761b5bc88a2145bc7f5a42538f71a946624014bd6edec17808a/aiostream-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "58364967059a2189de677b636d7c8dba", "sha256": "392d1771aa09cb4e08068e74527c9197aa20c9c46f86a801b1435682852e11ec" }, "downloads": -1, "filename": "aiostream-0.2.3.tar.gz", "has_sig": false, "md5_digest": "58364967059a2189de677b636d7c8dba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15942, "upload_time": "2016-11-21T16:51:36", "url": "https://files.pythonhosted.org/packages/31/6e/c086114a0dc3e7e6e4e76f2cb5c9e78a768172942efafa71e4c006fbe0ed/aiostream-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "cf3b1722e64a92b4766316f47975ab04", "sha256": "6ec078b51bbc4beb6608ab0b97347ee61f108edcfeaf8d4f8c0a88d51f1f7b7c" }, "downloads": -1, "filename": "aiostream-0.2.4.tar.gz", "has_sig": false, "md5_digest": "cf3b1722e64a92b4766316f47975ab04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15167, "upload_time": "2017-06-19T13:00:48", "url": "https://files.pythonhosted.org/packages/5e/b0/e656eca1a59024048322c0b6b9ab00943f6fd6e4fb40426f00ea01a2546a/aiostream-0.2.4.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "6ef1f777a016fbdf4e5ba81c41de59b6", "sha256": "57e34b0432efb7e4dd454534031bbe8f0aa55d4d62e919f6faee77e3fc04c8d9" }, "downloads": -1, "filename": "aiostream-0.2.6.tar.gz", "has_sig": false, "md5_digest": "6ef1f777a016fbdf4e5ba81c41de59b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16403, "upload_time": "2017-12-20T11:37:36", "url": "https://files.pythonhosted.org/packages/3e/76/da1f15b1c8f0222059957b5049487ed5b11184e5fe56cb5219a07d717747/aiostream-0.2.6.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e8d3cebb5ef318f67b5efe2c0b268faa", "sha256": "dd8b12509798ef6f128eb00d02682d6d527066a8c9d773f85e4749e34debf872" }, "downloads": -1, "filename": "aiostream-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e8d3cebb5ef318f67b5efe2c0b268faa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17809, "upload_time": "2018-01-05T14:30:49", "url": "https://files.pythonhosted.org/packages/7d/29/a9d09717ef4a64b8fe65446bcc1173766c0f1a5d9dbb45ae4a17e2ecdd88/aiostream-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "7386ec39fc1aeaa55f0e61c0addb15fa", "sha256": "2f7be31c02789975269d91c5fa5764661fae9562682e29630b964f5f83383e2e" }, "downloads": -1, "filename": "aiostream-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7386ec39fc1aeaa55f0e61c0addb15fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20185, "upload_time": "2018-08-09T12:57:53", "url": "https://files.pythonhosted.org/packages/8b/01/9084398426ac37cec00489da621885dab07f84ce342345f90380b7087926/aiostream-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "193362daaf9ca0dd9e89896be9167817", "sha256": "cd20f5b474b05e874ae8640630162a55beaa8be8a467ef5f3da74092ea085249" }, "downloads": -1, "filename": "aiostream-0.3.2.tar.gz", "has_sig": false, "md5_digest": "193362daaf9ca0dd9e89896be9167817", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18787, "upload_time": "2019-08-01T14:59:37", "url": "https://files.pythonhosted.org/packages/b1/8b/a8bd71c931c424d37a6336fd7a2df4c6b9432847c9752b7809f0e1d9aa7e/aiostream-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "4d0a5580aa29053f6ba628fbfc81e44c", "sha256": "6affc218f5b7dd8ef4a3ce33240fe5d46f326947d9d453d2db10c8061c13f676" }, "downloads": -1, "filename": "aiostream-0.3.3.tar.gz", "has_sig": false, "md5_digest": "4d0a5580aa29053f6ba628fbfc81e44c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18806, "upload_time": "2019-08-27T16:47:39", "url": "https://files.pythonhosted.org/packages/e1/06/250fa4e6700b73ec7e8e1860e02382560be8414672e1be266d62696150c5/aiostream-0.3.3.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "c4506d49ed3c82f10390fad37e0a33a9", "sha256": "546657bb573cc89ea92dd00fa99ed53e2ee6fcd8daf2f97ef374f07e0cd15bfa" }, "downloads": -1, "filename": "aiostream-0.4.0.tar.gz", "has_sig": false, "md5_digest": "c4506d49ed3c82f10390fad37e0a33a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19170, "upload_time": "2019-10-04T14:07:41", "url": "https://files.pythonhosted.org/packages/11/93/f8a6f4a875a58d09d568a7084c6c51d185687e47a4b0d58a42e35aa73a9d/aiostream-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c4506d49ed3c82f10390fad37e0a33a9", "sha256": "546657bb573cc89ea92dd00fa99ed53e2ee6fcd8daf2f97ef374f07e0cd15bfa" }, "downloads": -1, "filename": "aiostream-0.4.0.tar.gz", "has_sig": false, "md5_digest": "c4506d49ed3c82f10390fad37e0a33a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19170, "upload_time": "2019-10-04T14:07:41", "url": "https://files.pythonhosted.org/packages/11/93/f8a6f4a875a58d09d568a7084c6c51d185687e47a4b0d58a42e35aa73a9d/aiostream-0.4.0.tar.gz" } ] }