Metadata-Version: 2.1
Name: iterwrapper
Version: 0.1.1
Summary: A wrapper for FP style iterator manipulation
Home-page: https://github.com/Prunoideae/IterWrapper
Author: Prunoideae
Author-email: a455167189@163.com
License: UNKNOWN
Description: # IterWrapper
        
        This is a wrapper for python iterators to give it a style like those in Rust among with other methods, to improve the consistency and code readablity of iterator manipulation.
        
        A example for this is something like :
        
        ```python
        from iters.iters import IterWrapper as iw
        l = (
            iw(range(0,10))
            .map(lambda x:x+1)
            .filter(lambda x:x%2==0)
            .fold(lambda c, x: c+x**2, d=0)
        )
        
        print(l) # 220 = 2^2 + 4^2 + 6^2 + 8^2 + 10^2
        ```
        
        comparing to the equivalent representation in vanilla python :
        
        ```python
        l = sum(map(lambda x: x**2, filter(lambda x:x%2==0, map(lambda x: x+1, range(0,10)))))
        # or
        r = range(0, 10)
        m = map(lambda x: x+1, r)
        f = filter(lambda x: x%2==0, m)
        c = map(lambda x: x**2, f)
        l = sum(c)
        ```
        
        Another one:
        
        ```python
        from iterwrapper.iterwrapper import IterWrapper as iw
        l = (
            iw(range(0,10))
            .map(lambda x: x+1)
            .filter(lambda x: x%2==0)
            .map(str)
            .collect(', '.join)
        )
        
        print(l) # "2, 4, 6, 8, 10"
        
        # Comparing to
        
        l = ', '.join(map(str, filter(lambda x: x%2==0, map(lambda x: x+1, range(0,10)))))
        
        # or
        
        r = range(0, 10)
        m = map(lambda x: x+1, r)
        f = filter(lambda x: x%2==0, m)
        ms = map(str, f)
        l = ', '.join(ms)
        
        ```
        
        The main goal of this only is to be a convenient wrapper to manipulate iterators, so it comes with high compatibility since most of the method is done by accessing the wrapped iterator, and most of the method just use the wrapper as a container.
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
