Wikidata parser for transport networks.
Requirements: Python 3.9.
pip install .
To parse Prague metro system one should specify system Wikidata item (Q190271 for Prague Metro) and arbitrary station Wikidata item (Q1877386 for Florenc metro station).
metro --system 190271 --station 1877386
Result will be in out/metro.json
file with the following structure:
{
"id": "<TEXT IDENTIFIER>",
"stations": ["<STATION STRUCTURE>"],
"lines": ["<LINE STRUCTURE>"]
}
{
"id": "<LINE IDENTIFIER>/<STATION SHORT IDENTIFIER>",
"line": "<LINE IDENTIFIER>",
"names": {
"<LANGUAGE>": "<NAME>"
},
"open_time": "",
"geo_positions": ["<LATITUDE>", "<LONGITUDE>"],
"connections": [
{
"to": "<OTHER STATION IDENTIFIER>",
"type": "<CONNECTION TYPE>"
}
],
"site_links": [
{
"<SITE>": "<PAGE NAME>"
}
]
}
{
"id": "<LINE IDENTIFIER>/<STATION SHORT IDENTIFIER>",
"names": {
"<LANGUAGE>": "<NAME>"
},
"color": "<LINE COLOR>"
}