Create core_alphabetical.py

This commit is contained in:
henriquenakashima 2020-12-01 20:48:05 -05:00
parent fd10676706
commit a0b29fc448
3 changed files with 62 additions and 22 deletions

31
core_alphabetical.py Normal file
View file

@ -0,0 +1,31 @@
# Generate a draft pool for dr4ft.info
import csv
import cube_json
import cubecobra_csv
CUBE_NAME = 'TheElegantCube_fetched'
def main():
csv_path = cube_json.request_cube_csv('TheElegantCube_fetched', 'elegant')
core_cards = []
with open(csv_path) as f:
reader = csv.reader(f)
header_line = next(reader)
cubecobra_csv.assert_header(header_line)
for line in reader:
card = line[cubecobra_csv.COLUMNS['Name']]
tags = line[cubecobra_csv.COLUMNS['Tags']].split(', ')
if 'core' in tags:
core_cards.append(card)
core_cards.sort()
for card in core_cards:
print(card)
if __name__ == '__main__':
main()