Adding warnings to transformation factory, and code formating.

This commit is contained in:
Romain Dorgueil
2017-09-30 11:58:37 +02:00
parent b26dbc83cb
commit ef938c9970
4 changed files with 30 additions and 19 deletions

View File

@ -48,7 +48,6 @@ def normalize(row):
return result
def display(row):
print(Style.BRIGHT, row.get('name'), Style.RESET_ALL, sep='')
@ -69,15 +68,15 @@ def display(row):
print(
' - {}address{}: {address}'.
format(Fore.BLUE, Style.RESET_ALL, address=', '.join(address))
format(Fore.BLUE, Style.RESET_ALL, address=', '.join(address))
)
print(
' - {}links{}: {links}'.
format(Fore.BLUE, Style.RESET_ALL, links=', '.join(row['links']))
format(Fore.BLUE, Style.RESET_ALL, links=', '.join(row['links']))
)
print(
' - {}geometry{}: {geometry}'.
format(Fore.BLUE, Style.RESET_ALL, **row)
format(Fore.BLUE, Style.RESET_ALL, **row)
)
print(
' - {}source{}: {source}'.format(
@ -87,7 +86,9 @@ def display(row):
graph = bonobo.Graph(
OpenDataSoftAPI(dataset=API_DATASET, netloc=API_NETLOC, timezone='Europe/Paris'),
OpenDataSoftAPI(
dataset=API_DATASET, netloc=API_NETLOC, timezone='Europe/Paris'
),
normalize,
bonobo.Filter(filter=lambda row: row.get('country') == 'France'),
bonobo.JsonWriter(path='fablabs.txt', ioformat='arg0'),