def build_pokedex_descriptions():

    gens = {1: '1', 2: '1', 3: '1', 4: '1', 5: '1', 6: '1',
            7: '2', 8: '2', 9: '2', 10: '3', 11: '3', 12: '3', 13: '3',
            14: '3', 15: '4', 16: '4', 17: '4', 18: '4', 19: '4', 20: '5',
            21: '5', 22: '5', 23: '6', 24: '6'}

    descrips = open('data/v1/pokedex_descriptions.csv', 'rb')
    c = 0
    for row in csv.reader(descrips, delimiter=','):
        if row[0] != 'species_id' and int(row[2]) == 9:
            p = Pokemon.objects.get(pkdx_id=int(row[0]))
            g = Game.objects.get(pk=row[1])
            d, _ = Description.objects.get_or_create(
                name=p.name+'_gen_'+gens[int(row[1])],
                description=row[3])
            d.game.add(g)
            d.save()
            print 'Description %s created, %s added' % (d.name, g.name)
            c += 1

    print 'made %s descriptions' % str(c)
Build the pokedex descriptions for Pokemon
dataset/ETHPy150Open phalt/pokeapi/data/v1/build.py/build_pokedex_descriptions