def venues_to_docs(): """ For each venue, creates a file of all related shouts, one shout per line. :return: None :rtype: None """ for ven in Venue.select(): with codecs.open('../../data/ven/{}.txt'.format(ven.id), 'w', encoding='utf-8') as ven_f: for checkin in ven.checkins: ven_f.write(checkin.shout) ven_f.write('\n')
def venues_to_doc(fname='../../data/allVenues.txt'): """ Writes all venues to one file. :param fname: filename of output file :return: None :rtype: None """ with codecs.open(fname, 'w', encoding='utf-8') as fout: for ven in Venue.select(): fout.write(ven.id + ' ') checkin_str = u' '.join(ven.checkins) fout.write(checkin_str) fout.write('\n')