{ "info": { "author": "Charles Tapley Hoyt", "author_email": "cthoyt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "multisplitby |build| |coverage|\n===============================\nSplit an iterable into multiple using arbitrary predicates.\n\nThis package comes with a single function: ``multisplitby.multi_split_by``.\n\nFor all lists ``values`` and ``predicates``, the following conditions are always true:\n\n1. ``1 + len(predicates) = len(list(multi_split_by(values, predicates)))``\n2. ``values == itertools.chain.from_iterable(multi_split_by(values, predicates))``\n\nNormal usage with one predicate:\n\n.. code-block:: python\n\n >>> values = range(4)\n >>> predicates = [lambda x: 2 < x]\n >>> list(map(list, multi_split_by(values, predicates)))\n [[0, 1, 2], [3]]\n\nNormal usage with several predicates:\n\n.. code-block:: python\n\n >>> values = range(9)\n >>> predicates = [lambda x: 2 < x, lambda x: 4 < x, lambda x: 7 < x]\n >>> list(map(list, multi_split_by(values, predicates)))\n [[0, 1, 2], [3, 4], [5, 6, 7], [8]]\n\nIf no values are given, will result in ``|predicates| + 1`` generators, all yielding empty lists.\n\n.. code-block:: python\n\n >>> values = []\n >>> predicates = [lambda x: 2 < x, lambda x: 4 < x, lambda x: 7 < x]\n >>> list(map(list, multi_split_by(values, predicates)))\n [[], [], [], []]\n\nIf no predicates are given, will result in a single generator that yields the original list:\n\n.. code-block:: python\n\n >>> values = range(4)\n >>> predicates = []\n >>> list(map(list, multi_split_by(values, predicates)))\n [[0, 1, 2, 3]]\n\nInstallation\n------------\nInstall from PyPI with:\n\n.. code-block:: bash\n\n $ pip install multisplitby\n\nor get the latest code from `GitHub `_ with:\n\n.. code-block:: bash\n\n $ git clone https://github.com/cthoyt/multisplitby.git\n $ cd multisplitby\n $ pip install -e .\n\n.. |build| image:: https://travis-ci.com/cthoyt/multisplitby.svg?branch=master\n :target: https://travis-ci.com/cthoyt/multisplitby\n\n.. |coverage| image:: https://codecov.io/gh/cthoyt/multisplitby/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/cthoyt/multisplitby\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/cthoyt/multisplitby/releases", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cthoyt/multisplitby", "keywords": "iteration", "license": "MIT", "maintainer": "Charles Tapley Hoyt", "maintainer_email": "cthoyt@gmail.com", "name": "multisplitby", "package_url": "https://pypi.org/project/multisplitby/", "platform": "", "project_url": "https://pypi.org/project/multisplitby/", "project_urls": { "Bug Tracker": "https://github.com/cthoyt/multisplitby/issues", "Download": "https://github.com/cthoyt/multisplitby/releases", "Homepage": "https://github.com/cthoyt/multisplitby", "Source Code": "https://github.com/cthoyt/multisplitby" }, "release_url": "https://pypi.org/project/multisplitby/0.0.1/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Split an iterable into multiple using arbitrary predicates.", "version": "0.0.1" }, "last_serial": 4664291, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "90bf5744c34633da12f8a9c9b314e6e3", "sha256": "ab9237c1366e0cd9eecc87cfa5c0330b4843dfcafe71408ea2d8864659f69897" }, "downloads": -1, "filename": "multisplitby-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "90bf5744c34633da12f8a9c9b314e6e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4025, "upload_time": "2019-01-05T21:41:57", "url": "https://files.pythonhosted.org/packages/b1/8f/a054cb80019076a42b2a2876b76aea0c48c44c2fefd86bc59782967fcc13/multisplitby-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17942d7abf678d6384f1901e0d6577cb", "sha256": "e40489fa174fd7afd28a895477e6eefc64d6cfd863cca6900530e436a40e356f" }, "downloads": -1, "filename": "multisplitby-0.0.1.tar.gz", "has_sig": false, "md5_digest": "17942d7abf678d6384f1901e0d6577cb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 5557, "upload_time": "2019-01-05T21:41:59", "url": "https://files.pythonhosted.org/packages/2b/2e/595fef86e166573aef74de303a95f89c6d6e32df8f036dc4b97279758d62/multisplitby-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "90bf5744c34633da12f8a9c9b314e6e3", "sha256": "ab9237c1366e0cd9eecc87cfa5c0330b4843dfcafe71408ea2d8864659f69897" }, "downloads": -1, "filename": "multisplitby-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "90bf5744c34633da12f8a9c9b314e6e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4025, "upload_time": "2019-01-05T21:41:57", "url": "https://files.pythonhosted.org/packages/b1/8f/a054cb80019076a42b2a2876b76aea0c48c44c2fefd86bc59782967fcc13/multisplitby-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17942d7abf678d6384f1901e0d6577cb", "sha256": "e40489fa174fd7afd28a895477e6eefc64d6cfd863cca6900530e436a40e356f" }, "downloads": -1, "filename": "multisplitby-0.0.1.tar.gz", "has_sig": false, "md5_digest": "17942d7abf678d6384f1901e0d6577cb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 5557, "upload_time": "2019-01-05T21:41:59", "url": "https://files.pythonhosted.org/packages/2b/2e/595fef86e166573aef74de303a95f89c6d6e32df8f036dc4b97279758d62/multisplitby-0.0.1.tar.gz" } ] }