Created
May 15, 2025 23:44
-
-
Save applecuckoo/6249763fcc8f156c603e960f26e4e655 to your computer and use it in GitHub Desktop.
fetches the contents of all non-blank VMS signs owned by the New Zealand Transport Agency using zeep and their SOAP API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # nzta-vms-fetcher-basic.py - fetches the contents of all non-blank VMS signs owned by the New Zealand Transport Agency using zeep and their SOAP API | |
| # SPDX-FileCopyrightText: applecuckoo <[email protected]> | |
| # SPDX-License-Identifier: GPL-3.0-or-later | |
| import zeep | |
| c = zeep.Client('https://trafficnz.info/service/TrafficService?wsdl') | |
| for signs in c.service.getSigns(): | |
| if signs['currentMessage'] != None: | |
| message = signs['currentMessage'].replace('[nl]', '\n').replace('[np]', '\n\n').replace('[jl4]', ' ') # bulk replace of tags used by NZTA, defined in NTCIP 1203 | |
| print('--------------------------------------') # horizontal rule | |
| print(f'{signs['name']}:') | |
| print(message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment