Skip to content

Instantly share code, notes, and snippets.

@applecuckoo
Created May 15, 2025 23:44
Show Gist options
  • Select an option

  • Save applecuckoo/6249763fcc8f156c603e960f26e4e655 to your computer and use it in GitHub Desktop.

Select an option

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
# 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