summaryrefslogtreecommitdiff
path: root/scripts/setup_eve_data.py
diff options
context:
space:
mode:
authorkboz <kutayboz@gmail.com>2026-09-27 22:36:36 +0200
committerkboz <kutayboz@gmail.com>2026-09-27 22:36:36 +0200
commit526c8ec005d03b17950e9f5e7fe74208b491dd68 (patch)
treeb6a5ea59040bf48ffd0953a5682a43648a03ca51 /scripts/setup_eve_data.py
parent1b59961ce2385252e3346ea6107b15a2c1feafe6 (diff)
downloadhaul-526c8ec005d03b17950e9f5e7fe74208b491dd68.tar.gz
feat(frontend): add guided setup flow for backend bootstrapgo-backend
Poll the backend /api/setup/status and show a Setup screen until data, auth, and backend readiness are confirmed. Remove the manual setup_auth.py and setup_eve_data.py scripts superseded by the automated setup endpoints.
Diffstat (limited to 'scripts/setup_eve_data.py')
-rw-r--r--scripts/setup_eve_data.py55
1 files changed, 0 insertions, 55 deletions
diff --git a/scripts/setup_eve_data.py b/scripts/setup_eve_data.py
deleted file mode 100644
index a7f7efd..0000000
--- a/scripts/setup_eve_data.py
+++ /dev/null
@@ -1,55 +0,0 @@
-from __future__ import annotations
-
-import bz2
-import shutil
-import sys
-import urllib.request
-from pathlib import Path
-
-
-ROOT_DIR = Path(__file__).resolve().parent.parent
-DATA_DIR = ROOT_DIR / "backend" / "data"
-BASE_URL = "https://www.fuzzwork.co.uk/dump/latest"
-
-REQUIRED_FILES = {
- "mapDenormalize.csv": f"{BASE_URL}/mapDenormalize.csv.bz2",
- "mapJumps.csv": f"{BASE_URL}/mapJumps.csv.bz2",
- "invTypes.csv": f"{BASE_URL}/invTypes.csv.bz2",
- "mapRegions.csv": f"{BASE_URL}/mapRegions.csv.bz2",
-}
-
-
-def download_and_extract(file_name: str, url: str) -> None:
- destination = DATA_DIR / file_name
- archive_path = destination.with_suffix(destination.suffix + ".bz2")
-
- if destination.exists():
- print(f"Skipping {file_name}; already exists.")
- return
-
- print(f"Downloading {file_name} from {url}")
-
- try:
- with urllib.request.urlopen(url, timeout=60) as response, archive_path.open("wb") as output_file:
- shutil.copyfileobj(response, output_file)
-
- with bz2.open(archive_path, "rb") as compressed_file, destination.open("wb") as output_file:
- shutil.copyfileobj(compressed_file, output_file)
- finally:
- archive_path.unlink(missing_ok=True)
-
- print(f"Wrote {destination}")
-
-
-def main() -> int:
- DATA_DIR.mkdir(parents=True, exist_ok=True)
-
- for file_name, url in REQUIRED_FILES.items():
- download_and_extract(file_name, url)
-
- print("EVE static data is ready.")
- return 0
-
-
-if __name__ == "__main__":
- raise SystemExit(main()) \ No newline at end of file