@@ -387,9 +387,9 @@ if __name__ == '__main__' :
#
# Let's run the export function ..., This will push files into a data-store of choice Redshift, PostgreSQL, MySQL ...
- _store = json.loads( (open(path) ).read())
+ _store = {"type":"sql.SQLWriter","args":json.loads( (open(path) ).read())}
- pipes = export.Factory.instance(type=TYPE,write_store={"type":"sql.SQLWriter","args":{"provider":"postgresql","db":"sample",}}) #"inspect":0,"cast":0}})
+ pipes = export.Factory.instance(type=TYPE,write_store=_store) #"inspect":0,"cast":0}})
# pipes[0].run()
for thread in pipes:
thread.start()
@@ -173,12 +173,14 @@ class Formatters :
def pos(self,value):
"""
formatting place of service information within a segment (REF)
+ @TODO: In order to accomodate the other elements they need to be specified in the configuration
+ Otherwise it causes problems on export
xchar = '>' if '>' in value else ':'
x = value.split(xchar)
x = {"code":x[0],"indicator":x[1],"frequency":x[2]} if len(x) == 3 else {"code":x[0],"indicator":None,"frequency":None}
- return x
+ return x['code']
class Parser (Process):
def __init__(self,path):