Skip to content

A chain-able generator for python; inspired by the syntactical sugar of java stream

License

Notifications You must be signed in to change notification settings

Arnoldosmium/pystreamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pystreamer

Build Status

A lazy evaluating, memory friendly, chainable stream solution.

Inspired by the syntactical sugar of Java stream.

from streamer import Stream
with open("myfile.txt") as f_input:
    uniq = Stream(f_input) \
        .map(str.strip) \
        .flat_map(str.split) \
        .collect(set)   # uniq tokens in a file

About

A chain-able generator for python; inspired by the syntactical sugar of java stream

Topics

Resources

License

Stars

Watchers

Forks