Fix scryfall_requests.py
This commit is contained in:
parent
0a3cf8d657
commit
1413223b3e
3 changed files with 17 additions and 12 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
|
@ -1,3 +1,9 @@
|
|||
cards_in_draft.txt
|
||||
oracle_cards.json
|
||||
cube_temp.json
|
||||
oracle_cards_clean.json
|
||||
scryfall/
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
|
@ -128,7 +134,4 @@ dmypy.json
|
|||
# Pyre type checker
|
||||
.pyre/
|
||||
.idea/workspace.xml
|
||||
cards_in_draft.txt
|
||||
oracle_cards.json
|
||||
cube_temp.json
|
||||
oracle_cards_clean.json
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
import keyword_stats
|
||||
|
||||
if __name__ == '__main__':
|
||||
f = open('set_codes.txt')
|
||||
f = open('set_codes.csv')
|
||||
codes = [line.strip() for line in f.readlines()]
|
||||
output_file = open('set_keyword_frequency.csv', 'w+')
|
||||
output_file.write('Set,Keywords\n')
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
|
|
@ -30,11 +31,12 @@ def request_set(code):
|
|||
f.close()
|
||||
|
||||
|
||||
sets = []
|
||||
set_file = open('set_codes.txt')
|
||||
for line in set_file:
|
||||
sets += [line.strip()]
|
||||
set_file.close()
|
||||
if __name__ == '__main__':
|
||||
sets = []
|
||||
with open('set_codes.csv') as set_file:
|
||||
for line in set_file:
|
||||
sets += [line.strip()]
|
||||
|
||||
for code in sets:
|
||||
request_set(code)
|
||||
os.makedirs(os.path.join('scryfall', 'sets'), exist_ok=True)
|
||||
for code in sets:
|
||||
request_set(code)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue