From 7f6b16743e37c54586f35923614012bd65f6825f Mon Sep 17 00:00:00 2001 From: Wirusik Date: Sun, 20 Mar 2022 18:12:59 +0100 Subject: [PATCH] download dataset from python script --- .gitignore | 3 +++ init.py | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .gitignore create mode 100644 init.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1521a29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +df_atp.csv +df_wta.csv +atp-and-wta-tennis-data.zip \ No newline at end of file diff --git a/init.py b/init.py new file mode 100644 index 0000000..46bf6bf --- /dev/null +++ b/init.py @@ -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"]) \ No newline at end of file