def write_anki_table(conn, table_name, new_records, do_commit=True):
    """

    :param sqlite3.Connection conn:
    :param 'notes'|'cards' table_name:
    :param iter of OrderedDict new_records:
    :param bool do_commit:
    :return:
    """
    for new_record in new_records:
        conn.execute('INSERT INTO {} ({}) VALUES ({})'.format(table_name,
            ','.join(new_record.keys()), ','.join(['?' for _ in range(len(
            new_record))])), tuple(new_record.values()))
    if do_commit:
        conn.commit()
