{ "info": { "author": "Adam Karpierz", "author_email": "adam@karpierz.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: zlib/libpng License", "Natural Language :: Polish", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: IronPython", "Programming Language :: Python :: Implementation :: Jython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: Stackless", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "renumerate\n==========\n\nReverse enumerate.\n\nOverview\n========\n\n**renumerate(sequence, start=len(sequence)-1, end=0):**\n\n | Return an enumerate_ object.\n | *sequence* must be an object that has a __reversed__() method or supports the\n | sequence protocol (the __len__() method and the __getitem__() method with\n | integer arguments starting at 0).\n | The __next__() method of the iterator returned by renumerate() returns a tuple\n | containing a count (from *start* which defaults to len(*sequence*) - 1 or ends at\n | *end* which defaults to 0 - but not both) and the values obtained from reverse\n | iterating over *sequence*.\n\n.. code:: python\n\n >>> from renumerate import renumerate\n >>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']\n >>> list(renumerate(seasons))\n [(3, 'Winter'), (2, 'Fall'), (1, 'Summer'), (0, 'Spring')]\n >>> list(renumerate(seasons, start=4))\n [(4, 'Winter'), (3, 'Fall'), (2, 'Summer'), (1, 'Spring')]\n >>> list(renumerate(seasons, end=2))\n [(5, 'Winter'), (4, 'Fall'), (3, 'Summer'), (2, 'Spring')]\n\nEquivalent to:\n\n.. code:: python\n\n def renumerate(sequence, start=None, end=None):\n if start is not None and end is not None:\n raise TypeError(\"renumerate() only accepts start argument or end argument\"\n \" - not both.\")\n if start is None: start = len(sequence) - 1\n if end is None: end = 0\n n = start + end\n for elem in reversed(sequence):\n yield n, elem\n n -= 1\n\nInstallation\n============\n\nPrerequisites:\n\n+ Python 2.7 or Python 3.4 or later\n\n * http://www.python.org/\n * 2.7 and 3.7 are primary test environments.\n\n+ pip and setuptools\n\n * http://pypi.org/project/pip/\n * http://pypi.org/project/setuptools/\n\nTo install run::\n\n python -m pip install --upgrade renumerate\n\nDevelopment\n===========\n\nVisit `development page `__\n\nInstallation from sources:\n\nClone the `sources `__ and run::\n\n python -m pip install ./renumerate\n\nor on development mode::\n\n python -m pip install --editable ./renumerate\n\nPrerequisites:\n\n+ Development is strictly based on *tox*. To install it run::\n\n python -m pip install tox\n\nLicense\n=======\n\n | Copyright (c) 2016-2019 Adam Karpierz\n |\n | Licensed under the zlib/libpng License\n | http://opensource.org/licenses/zlib/\n | Please refer to the accompanying LICENSE file.\n\nAuthors\n=======\n\n* Adam Karpierz \n\n.. _`development page`: https://github.com/karpierz/renumerate/\n\n.. _enumerate: http://docs.python.org/library/functions.html#enumerate\n\nChangelog\n=========\n\n1.0.9 (2019-05-22)\n------------------\n- Drop support for Python 2.\n\n1.0.8 (2019-05-21)\n------------------\n- Update required setuptools version.\n- Setup update and improvements.\n- This is the latest release that supports Python 2.\n\n1.0.7 (2018-11-08)\n------------------\n- Drop support for Python 2.6 and 3.0-3.3\n- Update required setuptools version.\n\n1.0.6 (2018-05-08)\n------------------\n- Fix a bug in description.\n- Update required setuptools version.\n- Improve and simplify setup and packaging.\n\n1.0.5 (2018-02-26)\n------------------\n- Improve and simplify setup and packaging.\n\n1.0.4 (2018-01-28)\n------------------\n- Fix a bug and inconsistencies in tox.ini\n- Update of README.rst.\n\n1.0.1 (2018-01-24)\n------------------\n- Update required Sphinx version.\n- Update doc Sphinx configuration files.\n\n1.0.0 (2017-11-18)\n------------------\n- Setup improvements.\n- Other minor improvements.\n\n1.0.0b1 (2017-11-18)\n--------------------\n- Minor improvements.\n\n0.3.4 (2017-01-05)\n------------------\n- Minor setup improvements.\n\n0.3.3 (2016-09-25)\n------------------\n- Fix bug in setup.py\n\n0.3.1 (2016-09-25)\n------------------\n- More PEP8 compliant\n\n0.2.2 (2016-09-24)\n------------------\n- Description suplement\n- Minor fixes.\n\n0.1.1 (2016-09-24)\n------------------\n- First useful release.\n\n0.0.2 (2016-09-23)\n------------------\n- Initial release.", "description_content_type": "", "docs_url": null, "download_url": "http://pypi.org/project/renumerate/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.org/project/renumerate/", "keywords": "renumerate,enumerate", "license": "zlib/libpng License ; http://opensource.org/licenses/zlib/", "maintainer": "Adam Karpierz", "maintainer_email": "adam@karpierz.net", "name": "renumerate", "package_url": "https://pypi.org/project/renumerate/", "platform": "any", "project_url": "https://pypi.org/project/renumerate/", "project_urls": { "Download": "http://pypi.org/project/renumerate/", "Homepage": "http://pypi.org/project/renumerate/" }, "release_url": "https://pypi.org/project/renumerate/1.0.9/", "requires_dist": null, "requires_python": ">=3.4.0", "summary": "Reverse enumerate", "version": "1.0.9" }, "last_serial": 5853201, "releases": { "1.0.7": [ { "comment_text": "", "digests": { "md5": "81bdb8d82e34712d29212604ff801e95", "sha256": "2da53f82417ef5db983b3218bd48a6e667e5dfb4b02dd59d0b0a3386df81edfd" }, "downloads": -1, "filename": "renumerate-1.0.7.zip", "has_sig": false, "md5_digest": "81bdb8d82e34712d29212604ff801e95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11846, "upload_time": "2018-11-08T20:48:27", "url": "https://files.pythonhosted.org/packages/0c/17/3fe3b1761cda3f256817d091440ce42d4f82dd9f64cd4a946c7c676203ae/renumerate-1.0.7.zip" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "c324b634f05ec5eb33a7db2c900c4fa2", "sha256": "8dfbd0945b0bbe882cf56010271990bd98f15bd848c0da9692035d3d58896a7a" }, "downloads": -1, "filename": "renumerate-1.0.8.zip", "has_sig": false, "md5_digest": "c324b634f05ec5eb33a7db2c900c4fa2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 16029, "upload_time": "2019-05-21T23:04:15", "url": "https://files.pythonhosted.org/packages/ce/f8/331861d74db2fc17b678f94d3b7f2a34901c139708e0515bea5e232240aa/renumerate-1.0.8.zip" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "387a11c1bd60758a09fad78ccbf6eb8f", "sha256": "d3a4bc94fe7249202a146b6d99299311563ec13ec4f593af05d9ac3c2dd4807f" }, "downloads": -1, "filename": "renumerate-1.0.9.zip", "has_sig": false, "md5_digest": "387a11c1bd60758a09fad78ccbf6eb8f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.0", "size": 15842, "upload_time": "2019-05-21T23:17:41", "url": "https://files.pythonhosted.org/packages/99/16/d881e44e4e1269537fed7243f5380bdeb3848c97321929ed8bca1d7cee69/renumerate-1.0.9.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "387a11c1bd60758a09fad78ccbf6eb8f", "sha256": "d3a4bc94fe7249202a146b6d99299311563ec13ec4f593af05d9ac3c2dd4807f" }, "downloads": -1, "filename": "renumerate-1.0.9.zip", "has_sig": false, "md5_digest": "387a11c1bd60758a09fad78ccbf6eb8f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.0", "size": 15842, "upload_time": "2019-05-21T23:17:41", "url": "https://files.pythonhosted.org/packages/99/16/d881e44e4e1269537fed7243f5380bdeb3848c97321929ed8bca1d7cee69/renumerate-1.0.9.zip" } ] }