Metadata-Version: 1.1
Name: slicerator
Version: 0.9.7
Summary: A lazy-loading, fancy-sliceable iterable.
Home-page: http://github.com/soft-matter/slicerator
Author: Daniel B. Allan
Author-email: daniel.b.allan@gmail.com
License: BSD
Description: Slicerator

        ==========

        

        a lazy-loading, fancy-slicable iterable

        

        Think of it like a generator that is "reusable" and has a length.

        

        |build status|

        

        Installation

        ------------

        

        On any platform, use pip or conda.

        

        ``pip install slicerator``

        

        or

        

        ``conda install -c soft-matter slicerator``

        

        Example

        -------

        

        ::

        

            from slicerator import Slicerator

        

            @Slicerator.from_class

            class MyLazyLoader:

                def __getitem__(self, i):

                    # this method will be wrapped by Slicerator, so that it accepts slices,

                    # lists of integers, or boolean masks. Code below will only be executed

                    # when an integer is used.

        

                    # load thing number i

                    return thing

        

                def __len__(self):

                    # do stuff

                    return number_of_things

        

        

            # Demo:

            >>> a = MyLazyLoader()

            >>> s1 = a[::2]  # no data is loaded yet

            >>> s2 = s1[1:]  # no data is loaded yet

            >>> some_data = s2[0]

        

        .. |build status| image:: https://travis-ci.org/soft-matter/slicerator.png?branch=master

           :target: https://travis-ci.org/soft-matter/slicerator

        
Platform: Cross platform (Linux
Platform: Mac OSX
Platform: Windows)
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
