{ "info": { "author": "Kevin Conway", "author_email": "kevinjacobconway@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==========\naitertools\n==========\n\n*Async versions of the itertools features.*\n\nExample Usage\n=============\n\nThe behaviour of each feature in this project is designed to match, one-to-one,\nthe behaviour of each feature in the Python `itertools` module. The primary\ndifference of this package is that all features can additionally consume\nasync functions and async iterables in addition to the sync versions. All\nfunctions also return async iterables.\n\nWrapping Sync Code\n------------------\n\nWhen working with sync iterables in an async world you may want to wrap things\nin an async interface for interoperability with other async tools. For example,\na typical sync call to `chain` might look like:\n\n.. code-block:: python\n\n iter1 = (1, 2, 3, 4)\n iter2 = (5, 6, 7, 8)\n iter3 = (9, 10, 11, 12)\n\n for value in itertools.chain(iter1, iter2, iter3):\n\n print(value)\n\nThe above would output numbers 1 - 12 in the order shown. However, in the async\nworld not all iterables are tuples and lists. The same thing can be\naccomplished with the async `chain`:\n\n.. code-block:: python\n\n iter1 = (1, 2, 3, 4)\n iter2 = (5, 6, 7, 8)\n iter3 = (9, 10, 11, 12)\n\n async for value in aitertools.chain(iter1, iter2, iter3):\n\n print(value)\n\nThe above behaves exactly as the sync version except that it exposes the async\niteratable interface and works with `async def`.\n\nMixing Sync and Async\n---------------------\n\nAll functions in the `aitertools` package accept both sync and async iterables.\nThis allows for the combination of the two when needed:\n\n.. code-block:: python\n\n iter1 = (1, 2, 3, 4)\n iter2 = some_async_iter() # Async resolves to 5, 6, 7, 8\n\n async for value in aitertools.chain(iter1, iter2):\n\n print(value)\n\nEnsuring Async Interfaces\n-------------------------\n\nThis package also provides a handful of tools for working with the async\ninterfaces:\n\n - aiter\n\n Async function that counters `iter`. This function, when given an\n async iterable, will return an async iterator. When given a sync\n iterable it will wrap it and return an async iterator.\n\n - anext\n\n Async function that counters `next`. This function calls the\n `__anext__()` method of the iterator and returns the value. It,\n like the `next` method, can optionally return a default value when\n the iterator is empty.\n\n - alist\n\n Async function that counters `list`. For use cases like\n `list(iterable)` this function allows for `await alist(iterable)`.\n\n - atuple\n\n Async function that counters `tuple`. Similar to the `alist` above.\n\nDevelopment Roadmap\n===================\n\nThe current release of this package is only missing the `permutations`,\n`combinations`, and `combinations_with_replacement` features. The next release\nshould contain these missing features.\n\nAdditionally, several features from functools and the available globals are\nslated for addition. For example, the `filter`, `map`, and `reduce` features\nare good fits for this package and already have at least one `itertools`\ncounterpart added.\n\nTesting\n=======\n\nAll tests are stored in the '/tests' subdirectory. All tests are expected to\npass for Python 3.5 and above. To run tests create a virtualenv and install\nthe test-requirements.txt list. After that using the `tox` command will launch\nthe test suite.\n\nLicense\n=======\n\n Copyright 2015 Kevin Conway\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\nContributing\n============\n\nFirstly, if you're putting in a patch then thank you! Here are some tips for\ngetting your patch merged:\n\nStyle\n-----\n\nAs long as the code passes the PEP8 and PyFlakes gates then the style is\nacceptable.\n\nDocs\n----\n\nThe PEP257 gate will check that all public methods have docstrings. If you're\nadding additional features from the `itertools` module try to preserve the\noriginal docstrings if possible. Sometimes the original docs don't fit well\nwith the PEP257 format. In those cases it is OK to modify the docstring to fit.\nIf you're adding something new, like a helper function, try out the\n`napoleon style of docstrings `_.\n\nTests\n-----\n\nMake sure the patch passes all the tests. If you're adding a new feature from\n`itertools` be sure to add some of the original, standard library tests. The\ntests used to validate the Python `itertools` module are found in the\n'/Lib/test/test_itertools.py' file in the Python source. The orginal tests are\norganized into large blocks of tests based on features. As much as possible,\nbreak the tests up into individual units. Check out the existing tests for this\nproject for inspiration if needed.\n\nIf you're adding something totally new the make sure to throw in a few tests.\nIf you're fixing a bug then definitely add at least one test to prevent\nregressions.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/asyncdef/aitertools", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "aitertools", "package_url": "https://pypi.org/project/aitertools/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/aitertools/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/asyncdef/aitertools" }, "release_url": "https://pypi.org/project/aitertools/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Async versions of the itertools features.", "version": "0.1.0" }, "last_serial": 1773341, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6ec839a12053f74e0dd044cd5389e5f6", "sha256": "365b51839972ce8ac30acaa4c8682c62bc0678cc21a39709cea4639a2e821249" }, "downloads": -1, "filename": "aitertools-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6ec839a12053f74e0dd044cd5389e5f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15261, "upload_time": "2015-10-17T22:06:56", "url": "https://files.pythonhosted.org/packages/0a/9a/12e04eeecccfef606d8745e6d876bef4eec3eb6d771263f9c82bd4fc93ec/aitertools-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6ec839a12053f74e0dd044cd5389e5f6", "sha256": "365b51839972ce8ac30acaa4c8682c62bc0678cc21a39709cea4639a2e821249" }, "downloads": -1, "filename": "aitertools-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6ec839a12053f74e0dd044cd5389e5f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15261, "upload_time": "2015-10-17T22:06:56", "url": "https://files.pythonhosted.org/packages/0a/9a/12e04eeecccfef606d8745e6d876bef4eec3eb6d771263f9c82bd4fc93ec/aitertools-0.1.0.tar.gz" } ] }