# Path: orm.py
# def now():
# def set_sqlite_pragma(dbapi_connection, connection_record):
#     def is_blank(self):
#     def save(self):
#     def save(self):
#     def save(self):
# def counter():
# def exithandler():
# class Value(Base):
# class DataSet(Base):
# class Indicator(Base):


import xypath
import messytables
import orm
import re
import time
import dl
from hamcrest import equal_to, is_in
from orm import session, Value, DataSet, Indicator
DT.ODA.ODAT.PC.ZS
IT.CEL.SETS.P2
IT.NET.USER.P2
NE.CON.PRVT.PP.KD
EG.ELC.ACCS.ZS
SI.POV.GINI
FP.CPI.TOTL.ZG
SN.ITK.DEFC.ZS
IT.MLT.MAIN.P2
NY.GDP.PCAP.PP.KD
SH.DYN.AIDS.ZS
SL.EMP.INSV.FE.ZS
""".strip().split('\n')


"""Value: dsID, region, indID, period, value, source, is_number
   DataSet: dsID, last_updated, last_scraped, name
   Indicator: indID, name, units
   """


dataset = {'dsID': 'World Bank',
           'last_updated': None,
           'last_scraped': orm.now(),
           'name': 'World Bank'}

DataSet(**dataset).save()


def getcountrylist():

# Path: orm.py
# def now():
# def set_sqlite_pragma(dbapi_connection, connection_record):
#     def is_blank(self):
#     def save(self):
#     def save(self):
#     def save(self):
# def counter():
# def exithandler():
# class Value(Base):
# class DataSet(Base):
# class Indicator(Base):


# Path: worldbank.py
import xypath
import messytables
import orm
import re
import time
import dl
from hamcrest import equal_to, is_in
from orm import session, Value, DataSet, Indicator

DT.ODA.ODAT.PC.ZS
IT.CEL.SETS.P2
IT.NET.USER.P2
NE.CON.PRVT.PP.KD
EG.ELC.ACCS.ZS
SI.POV.GINI
FP.CPI.TOTL.ZG
SN.ITK.DEFC.ZS
IT.MLT.MAIN.P2
NY.GDP.PCAP.PP.KD
SH.DYN.AIDS.ZS
SL.EMP.INSV.FE.ZS
""".strip().split('\n')


"""Value: dsID, region, indID, period, value, source, is_number
   DataSet: dsID, last_updated, last_scraped, name
   Indicator: indID, name, units
   """


dataset = {'dsID': 'World Bank',
           'last_updated': None,
           'last_scraped': orm.now(),
           'name': 'World Bank'}

DataSet(**dataset).save()


def getcountrylist():

    for value in session.query(Value).filter(Value.indID == "CG060").all():