This commit is contained in:
Andras Schmelczer 2026-02-07 19:13:36 +00:00
parent 555ba7cf53
commit 3c2e527328
6 changed files with 64 additions and 26 deletions

View file

@ -11,13 +11,13 @@ NAPTAN_CSV_URL = "https://naptan.api.dft.gov.uk/v1/access-nodes?dataFormat=csv"
STOP_TYPES = {
'AIR': "Airport",
'FTD': "Ferry",
"AIR": "Airport",
"FTD": "Ferry",
"RSE": "Rail station",
"BCT": "Bus stop",
"BCE": "Bus station",
"TXR": "Taxi rank",
"TMU": "Metro or Tram stop",
"TMU": "Metro or Tram stop",
}
@ -48,7 +48,7 @@ def download_naptan(output: Path) -> None:
)
df.write_parquet(output)
size_mb = output.stat().st_size / (1024 * 1024)
size_mb = output.stat().st_size / (1024 * 1024)
print(f"Wrote {output} ({size_mb:.1f} MB, {len(df):,} stations)")
counts = df.group_by("category").len().sort("len", descending=True)