Files
bonobo/examples/basic_extract_transform_load_of_strings.py
2016-12-09 08:01:04 +01:00

31 lines
415 B
Python

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)