Ejemplo n.º 1
0
def main():
    """>> python postgis_tiger.py -y 2015 -s OR WA"""

    # gv will be a namespace object that will hold all global variables
    global gv  
    args = sys.argv[1:]
    gv = process_options(args)

    pg_url = PG_URL.format(user=gv.user, pw=gv.password,
                           host=gv.host, db=gv.dbname)
    gv.engine = create_engine(pg_url)
    gv.metadata = MetaData(
        bind=gv.engine,
        schema='tiger{yr}'.format(yr=gv.tiger_year))

    download_tiger_data()
    create_tiger_schema(True)
    load_tiger_data()

    if gv.model:
        utils.generate_model(gv.metadata)
def main():
    """>> python postgis_tiger.py -y 2015 -s OR WA"""

    # gv will be a namespace object that will hold all global variables
    global gv  
    args = sys.argv[1:]
    gv = process_options(args)

    pg_url = PG_URL.format(user=gv.user, pw=gv.password,
                           host=gv.host, db=gv.dbname)
    gv.engine = create_engine(pg_url)
    gv.metadata = MetaData(
        bind=gv.engine,
        schema='tiger{yr}'.format(yr=gv.tiger_year))

    download_tiger_data()
    create_tiger_schema(True)
    load_tiger_data()

    if gv.model:
        utils.generate_model(gv.metadata)
def main():
    """"""

    # will be namespace for global variables
    global gv
    args = sys.argv[1:]
    gv = process_options(args)

    pg_url = PG_URL.format(user=gv.user, pw=gv.password,
                           host=gv.host, db=gv.dbname)
    gv.engine = create_engine(pg_url)
    gv.lookup_file = 'ACS_{span}yr_Seq_Table_Number_' \
                     'Lookup.txt'.format(span=gv.span)
    gv.metadata = MetaData(
        bind=gv.engine,
        schema=ACS_SCHEMA.format(yr=gv.acs_year, span=gv.span))

    download_acs_data()
    drop_create_acs_schema(True)
    create_geoheader()
    create_acs_tables()

    if gv.model:
        utils.generate_model(gv.metadata, make_table_mapping(), [GEOHEADER])