Metadata-Version: 2.1
Name: renumerate
Version: 1.1.2
Summary: Reverse enumerate.
Home-page: https://pypi.org/project/renumerate/
Author: Adam Karpierz
Author-email: adam@karpierz.net
Maintainer: Adam Karpierz
Maintainer-email: adam@karpierz.net
License: zlib/libpng License ; https://opensource.org/licenses/Zlib
Download-URL: https://pypi.org/project/renumerate/
Project-URL: Documentation, https://renumerate.readthedocs.io/
Project-URL: Source, https://github.com/karpierz/renumerate/
Description: renumerate
        ==========
        
        Reverse enumerate.
        
        Overview
        ========
        
        **renumerate(sequence, start=len(sequence)-1, end=0):**
        
        | Return an enumerate_ object.
        | *sequence* must be an object that has a __reversed__() method or supports the
          sequence protocol (the __len__() method and the __getitem__() method with
          integer arguments starting at 0).
        | The __next__() method of the iterator returned by renumerate() returns a tuple
          containing a count (from *start* which defaults to len(*sequence*) - 1 or ends at
          *end* which defaults to 0 - but not both) and the values obtained from reverse
          iterating over *sequence*.
        
        `PyPI record`_.
        
        Usage
        -----
        
        .. code:: python
        
          >>> from renumerate import renumerate
          >>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
          >>> list(renumerate(seasons))
          [(3, 'Winter'), (2, 'Fall'), (1, 'Summer'), (0, 'Spring')]
          >>> list(renumerate(seasons, start=4))
          [(4, 'Winter'), (3, 'Fall'), (2, 'Summer'), (1, 'Spring')]
          >>> list(renumerate(seasons, end=2))
          [(5, 'Winter'), (4, 'Fall'), (3, 'Summer'), (2, 'Spring')]
        
        Equivalent to:
        
        .. code:: python
        
          def renumerate(sequence, start=None, end=None):
              if start is not None and end is not None:
                  raise TypeError("renumerate() only accepts start argument or end argument"
                                  " - not both.")
              if start is None: start = len(sequence) - 1
              if end   is None: end   = 0
              n = start + end
              for elem in reversed(sequence):
                  yield n, elem
                  n -= 1
        
        Installation
        ============
        
        Prerequisites:
        
        + Python 3.6 or higher
        
          * https://www.python.org/
          * 3.7 is a primary test environment.
        
        + pip and setuptools
        
          * https://pypi.org/project/pip/
          * https://pypi.org/project/setuptools/
        
        To install run:
        
          .. parsed-literal::
        
            python -m pip install --upgrade |package|
        
        Development
        ===========
        
        Prerequisites:
        
        + Development is strictly based on *tox*. To install it run::
        
            python -m pip install --upgrade tox
        
        Visit `development page`_.
        
        Installation from sources:
        
        clone the sources:
        
          .. parsed-literal::
        
            git clone |respository| |package|
        
        and run:
        
          .. parsed-literal::
        
            python -m pip install ./|package|
        
        or on development mode:
        
          .. parsed-literal::
        
            python -m pip install --editable ./|package|
        
        License
        =======
        
          | Copyright (c) 2016-2020 Adam Karpierz
          | Licensed under the zlib/libpng License
          | https://opensource.org/licenses/Zlib
          | Please refer to the accompanying LICENSE file.
        
        Authors
        =======
        
        * Adam Karpierz <adam@karpierz.net>
        
        .. |package| replace:: renumerate
        .. |package_bold| replace:: **renumerate**
        .. |respository| replace:: https://github.com/karpierz/renumerate.git
        .. _development page: https://github.com/karpierz/renumerate/
        .. _PyPI record: https://pypi.org/project/renumerate/
        .. _enumerate: https://docs.python.org/library/functions.html#enumerate
        
        Changelog
        =========
        
        1.1.2 (2020-09-30)
        ------------------
        - Drop support for Python 3.5.
        - Add unittests.
        
        1.0.13 (2020-09-22)
        -------------------
        - Setup: fix an improper dependencies versions.
        
        1.0.12 (2020-09-20)
        -------------------
        - Add support for Python 3.9.
        - Setup general update and cleanup.
        
        1.0.10 (2019-11-12)
        -------------------
        - Drop support for Python 3.4.
        - Add support for Python 3.8.
        - Setup update and cleanup.
        
        1.0.9 (2019-05-22)
        ------------------
        - Drop support for Python 2.
        
        1.0.8 (2019-05-21)
        ------------------
        - Update required setuptools version.
        - Setup update and improvements.
        - This is the latest release that supports Python 2.
        
        1.0.7 (2018-11-08)
        ------------------
        - Drop support for Python 2.6 and 3.0-3.3.
        - Update required setuptools version.
        
        1.0.6 (2018-05-08)
        ------------------
        - Fix a bug in description.
        - Update required setuptools version.
        - Improve and simplify setup and packaging.
        
        1.0.5 (2018-02-26)
        ------------------
        - Improve and simplify setup and packaging.
        
        1.0.4 (2018-01-28)
        ------------------
        - Fix a bug and inconsistencies in tox.ini
        - Update of README.rst.
        
        1.0.1 (2018-01-24)
        ------------------
        - Update required Sphinx version.
        - Update doc Sphinx configuration files.
        
        1.0.0 (2017-11-18)
        ------------------
        - Setup improvements.
        - Other minor improvements.
        
        1.0.0b1 (2017-11-18)
        --------------------
        - Minor improvements.
        
        0.3.4 (2017-01-05)
        ------------------
        - Minor setup improvements.
        
        0.3.3 (2016-09-25)
        ------------------
        - Fix bug in setup.py
        
        0.3.1 (2016-09-25)
        ------------------
        - More PEP8 compliant.
        
        0.2.2 (2016-09-24)
        ------------------
        - Description suplement
        - Minor fixes.
        
        0.1.1 (2016-09-24)
        ------------------
        - First useful release.
        
        0.0.2 (2016-09-23)
        ------------------
        - Initial release.
        
Keywords: renumerate,enumerate
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: zlib/libpng License
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: Polish
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: Stackless
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <4.0.0,>=3.6.0
Description-Content-Type: text/x-rst; charset=UTF-8
Provides-Extra: doc
Provides-Extra: test
