Skip to content

lavriv92/sinks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sinks

Simple library to provide simple streams from various sources

Instalation

pip install sinks

Simple stream

from sinks import Source

add_six = lambda x: x + 6

(
    Source(2)
      >> add_six
      >> print
)()

Http stream

import pprint
from sinks import Source
from sinks.operators import extract_partials, group_by

r = (
  Source.from_json_url('https://jsonplaceholder.typicode.com/albums')
    >> extract_partials('id', 'title', 'userId')
    >> group_by('userId')
    >> pprint.pprint
)()

Generator stream

from sinks import GeneratorSource

add_six = lambda x: x + 6
divide = lambda x: x / 2

source = (
    GeneratorSource([1,2,3,4])
        >> add_six
        >> divide
)

for item in source:
    print(item)

About

Simple library to provide elegant streams

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages