work in progress ...
This commit is contained in:
0
examples/basic_extract_transform_load_of_dicts.py
Normal file
0
examples/basic_extract_transform_load_of_dicts.py
Normal file
30
examples/basic_extract_transform_load_of_strings.py
Normal file
30
examples/basic_extract_transform_load_of_strings.py
Normal file
@ -0,0 +1,30 @@
|
||||
from bonobo.strategy import NaiveStrategy, ExecutorStrategy
|
||||
|
||||
from bonobo.core.graph import Graph
|
||||
|
||||
|
||||
def extract():
|
||||
yield 'foo'
|
||||
yield 'bar'
|
||||
yield 'baz'
|
||||
|
||||
|
||||
def transform(s):
|
||||
return s.title()
|
||||
|
||||
|
||||
def load(s):
|
||||
print(s)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
etl = Graph()
|
||||
etl.add_chain(extract, transform, load)
|
||||
|
||||
s = NaiveStrategy()
|
||||
s.execute(etl)
|
||||
|
||||
s = ExecutorStrategy()
|
||||
s.execute(etl)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user