Ignore NETEX
This commit is contained in:
@@ -309,6 +309,12 @@ def download():
|
|||||||
records = data["records"]
|
records = data["records"]
|
||||||
logger.debug(json.dumps(records, indent=4))
|
logger.debug(json.dumps(records, indent=4))
|
||||||
for entry in records:
|
for entry in records:
|
||||||
|
# Le dataset contient aussi des flux NETEX (fichiers XML) qui n'ont pas
|
||||||
|
# la même structure que le GTFS: on les ignore.
|
||||||
|
typeflux = entry["fields"].get("typeflux", "GTFS")
|
||||||
|
if typeflux != "GTFS":
|
||||||
|
logger.debug("Skip %s record: %s", typeflux, entry["fields"]["id"])
|
||||||
|
continue
|
||||||
filename = "./downloads/" + entry["fields"]["fichier"]["filename"]
|
filename = "./downloads/" + entry["fields"]["fichier"]["filename"]
|
||||||
filename_info = filename + ".json"
|
filename_info = filename + ".json"
|
||||||
with open(filename_info, "w") as f:
|
with open(filename_info, "w") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user