Cache data sources
This commit is contained in:
parent
77c9a40dbf
commit
8c74f0a0bc
3 changed files with 11 additions and 3 deletions
|
|
@ -101,6 +101,10 @@ def convert_to_parquet(data_path: Path, parquet_path: Path) -> None:
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
if PARQUET_PATH.exists():
|
||||||
|
print(f"Parquet already exists at {PARQUET_PATH}, skipping")
|
||||||
|
return
|
||||||
|
|
||||||
if not DOWNLOAD_PATH.exists():
|
if not DOWNLOAD_PATH.exists():
|
||||||
download_with_progress(URL, DOWNLOAD_PATH)
|
download_with_progress(URL, DOWNLOAD_PATH)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,10 @@ def convert_to_parquet(csv_path: Path, parquet_path: Path) -> None:
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
if PARQUET_PATH.exists():
|
||||||
|
print(f"Parquet already exists at {PARQUET_PATH}, skipping")
|
||||||
|
return
|
||||||
|
|
||||||
if not CSV_PATH.exists():
|
if not CSV_PATH.exists():
|
||||||
download_with_progress(URL, CSV_PATH)
|
download_with_progress(URL, CSV_PATH)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ def main() -> None:
|
||||||
if not OPENAPI_SPEC.exists():
|
if not OPENAPI_SPEC.exists():
|
||||||
raise FileNotFoundError(f"OpenAPI spec not found: {OPENAPI_SPEC}")
|
raise FileNotFoundError(f"OpenAPI spec not found: {OPENAPI_SPEC}")
|
||||||
|
|
||||||
# Remove existing client if present
|
# Skip if client already exists
|
||||||
if OUTPUT_PATH.exists():
|
if OUTPUT_PATH.exists():
|
||||||
print(f"Removing existing client at {OUTPUT_PATH}")
|
print(f"TfL client already exists at {OUTPUT_PATH}, skipping")
|
||||||
shutil.rmtree(OUTPUT_PATH)
|
return
|
||||||
|
|
||||||
# Generate the client
|
# Generate the client
|
||||||
print(f"Generating client from {OPENAPI_SPEC}")
|
print(f"Generating client from {OPENAPI_SPEC}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue