download dataset from python script

This commit is contained in:
Wirusik 2022-03-20 18:12:59 +01:00
commit 7f6b16743e
2 changed files with 13 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
df_atp.csv
df_wta.csv
atp-and-wta-tennis-data.zip

10
init.py Normal file
View File

@ -0,0 +1,10 @@
import subprocess
from os.path import exists
file_exists = exists('./df_atp.csv')
if not file_exists:
subprocess.run(["pip", "install", "--user", "kaggle"])
subprocess.run(["pip", "install", "--user","pandas"])
subprocess.run(["kaggle", "datasets", "download", "-d", "hakeem/atp-and-wta-tennis-data"])
subprocess.run(["unzip", "-o", "atp-and-wta-tennis-data.zip"])