-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_data.py
More file actions
45 lines (35 loc) · 1.23 KB
/
Copy pathsetup_data.py
File metadata and controls
45 lines (35 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Download raw price data from Google Drive for re-running precompute.
The dashboard works out of the box using committed precomputed JSONs.
Only run this if you need to regenerate precomputed data from raw CSVs.
Usage:
pip install gdown
python setup_data.py
"""
import os
import sys
# Google Drive folder containing CSGO/Data (processed/ and raw/)
# Shared as restricted — only invited accounts can access
GDRIVE_FOLDER_ID = "1xd6LKGqj2nGoernD96QQXP7YRJD1O2gq"
OUT_DIR = "data/prices"
def main():
if os.path.exists(OUT_DIR) and os.listdir(OUT_DIR):
print(f"{OUT_DIR}/ already exists and is not empty. Skipping download.")
print("Delete it first if you want to re-download.")
return
try:
import gdown
except ImportError:
print("gdown is required: pip install gdown")
sys.exit(1)
os.makedirs(OUT_DIR, exist_ok=True)
print("Downloading price data from Google Drive...")
print("Note: You need access to the shared folder.")
gdown.download_folder(
id=GDRIVE_FOLDER_ID,
output=OUT_DIR,
quiet=False,
)
print(f"Done. Data saved to {OUT_DIR}/")
print("You can now run: python src/precompute.py")
if __name__ == "__main__":
main()