Beispiel #1
0
def main():
    """The main entrypoint for this process."""
    args = parse_args()

    make_session = bootstrap(
        'sqlite:///{}'.format(DB_NAME),
        )
    session = make_session()

    for vase in session.query(Vase).order_by(Vase.produced_start):
        for query_str in make_searches(vase):
            pass
Beispiel #2
0
def main():
    """The entry point to populating the database. """
    if '-X' in sys.argv or '--clear' in sys.argv:
        print('Removing {}'.format(DB_NAME))
        os.remove(DB_NAME)

    make_session = bootstrap(
        'sqlite:///{}'.format(DB_NAME), echo=True,
    )
    session = make_session()

    adapter = RowAdapter()
    for row in read_csv(CSV_FILE):
        for obj in adapter.adapt_vase(row):
            session.add(obj)

    session.commit()
Beispiel #3
0
def main():
    """The entry point to populating the database. """
    if '-X' in sys.argv or '--clear' in sys.argv:
        print('Removing {}'.format(DB_NAME))
        os.remove(DB_NAME)

    make_session = bootstrap(
        'sqlite:///{}'.format(DB_NAME),
        echo=True,
    )
    session = make_session()

    adapter = RowAdapter()
    for row in read_csv(CSV_FILE):
        for obj in adapter.adapt_vase(row):
            session.add(obj)

    session.commit()