Big refactoring, way simpler management of transformations. Early branch for upcoming version 0.2.

This commit is contained in:
Romain Dorgueil
2017-01-17 22:45:10 +01:00
parent b6e84c66e3
commit 8532520aae
41 changed files with 627 additions and 433 deletions

View File

@ -0,0 +1,29 @@
import time
from random import randint
from bonobo.core.graphs import Graph
def extract():
yield 'foo'
yield 'bar'
yield 'baz'
def transform(s):
wait = randint(0, 1)
time.sleep(wait)
return s.title() + ' ' + str(wait)
def load(s):
print(s)
graph = Graph()
graph.add_chain(extract, transform, load)
if __name__ == '__main__':
from bonobo import run
run(graph)