{ "info": { "author": "Koos Zevenhoven", "author_email": "koos.zevenhoven@aalto.fi", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "``views`` -- efficient tools for generators and sequences\n=========================================================\n\nThe ``views`` module provides additions to the existing python comprehensions and generator expressions. (Chained) sequence views can be made using ``seq`` and generators can be chained with ``gen``, as shown in the examples below.\n\nAny feedback or suggestions are very welcome.\n\n- Email: koos.zevenhoven@aalto.fi\n- Twitter: `@k7hoven `_\n\n\nGetting Started\n===============\n\nRequirements\n------------\n\n* Python 3.6+\n\nInstallation\n------------\n\nThe package can be installed with ``pip`` (make sure you have it installed):\n\n.. code-block:: bash\n\n \u00a0 pip3 install git+http://github.com/k7hoven/views\n\nOr if your default python is Python 3:\n\n.. code-block:: bash\n\n \u00a0 pip install git+http://github.com/k7hoven/views\n\n\nBasic Usage\n-----------\n\nBasic introductory examples here, but they should get you started.\n\nSequence view comprehension syntax\n''''''''''''''''''''''''''''''''''\n\nYou can change chain single objects and sequences into one sequence view. Use ``::`` just like you would use ``*`` in tuple (un)packing. The resulting object supports slicing and indexing.\n \nExample:\n\n.. code-block:: python\n\n >>> from views import seq\n >>> seq[::range(3), None, ::\"abc\", \"Hi!\"]\n \n >>> seq[::range(100)]\n \n\n\nGenerator comprehension syntax\n''''''''''''''''''''''''''''''\n\nUse like ``seq``. The resulting object is a generator.\n\nExample:\n\n.. code-block:: python\n\n \u00a0 \u00a0>>> from views import gen\n \u00a0 \u00a0>>> list(gen[::range(3), 3, 4, ::range(5,7), 7])\n [0, 1, 2, 3, 4, 5, 6, 7]\n\n\nChaining sequences and generators/iterables\n'''''''''''''''''''''''''''''''''''''''''''\n\nYou can chain an arbitrary number of sequences with ``seq.chain(*sequences)`` and of generators with ``gen.chain(*iterables)``. The latter is equivalent to ``itertools.chain(*iterables)``.\n\nExample:\n\n.. code-block:: python\n\n >>> from views import seq, gen\n >>> seq.chain([1, 2, 3], [4, 5, 6])\n \n >>> list(gen.chain([1, 2, 3], [4, 5, 6]))\n [1, 2, 3, 4, 5, 6]\n\n\nHave fun!\n\nChangelog\n=========\n\n0.3.0 (2017-10-10)\n------------------\n\n- Add ``seq.chain(*sequences)`` and ``gen.chain(*iterables)``\n- Some speed optimizations, especially to ``seq``.\n\n0.2.0 (2017-09-11)\n------------------\n\n- LengthChangedError is now a subclass of ``RuntimeError``.\n- Minor optimizations to ``seq`` and ``gen``.\n\n0.1.0 (2017-06-06)\n------------------\n\n- First version", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/k7hoven/views", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "views", "package_url": "https://pypi.org/project/views/", "platform": "", "project_url": "https://pypi.org/project/views/", "project_urls": { "Homepage": "https://github.com/k7hoven/views" }, "release_url": "https://pypi.org/project/views/0.3/", "requires_dist": null, "requires_python": "", "summary": "views", "version": "0.3" }, "last_serial": 3241788, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "f0212f66828a308a0408f9ef325c2eae", "sha256": "17f60ecbc213d5aaa8f5359973ab8840071123547e1897cae2f6e762b62dcd68" }, "downloads": -1, "filename": "views-0.3.tar.gz", "has_sig": false, "md5_digest": "f0212f66828a308a0408f9ef325c2eae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4665, "upload_time": "2017-10-11T11:34:54", "url": "https://files.pythonhosted.org/packages/1b/d9/5598d590f9467c364704397cbb0ebc9b33481b84e947c2af31cc1dc9fa11/views-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f0212f66828a308a0408f9ef325c2eae", "sha256": "17f60ecbc213d5aaa8f5359973ab8840071123547e1897cae2f6e762b62dcd68" }, "downloads": -1, "filename": "views-0.3.tar.gz", "has_sig": false, "md5_digest": "f0212f66828a308a0408f9ef325c2eae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4665, "upload_time": "2017-10-11T11:34:54", "url": "https://files.pythonhosted.org/packages/1b/d9/5598d590f9467c364704397cbb0ebc9b33481b84e947c2af31cc1dc9fa11/views-0.3.tar.gz" } ] }