Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Zetta Status Feed Examples (Python)
I've had to patch the PySimpleSoap '' file
Here's the replacement version of datetime_u(s)
In the original file, this function starts on line 417
This change strips any trailing "Z" character in timestamps
# Functions to serialize/deserialize special immutable types:
def datetime_u(s):
fmt = "%Y-%m-%dT%H:%M:%S"
return _strptime(s, fmt)
except ValueError:
# strip trailing z - Anthony Eden Patch
if s[-1] == "Z":
warnings.warn('removing unsupported trailing Z', RuntimeWarning)
s = s[:-1]
# strip utc offset
if s[-3] == ":" and s[-6] in (' ', '-', '+'):
warnings.warn('removing unsupported UTC offset', RuntimeWarning)
s = s[:-6]
# parse microseconds
return _strptime(s, fmt + ".%f")
return _strptime(s, fmt)
except ValueError:
# strip microseconds (not supported in this platform)
if "." in s:
warnings.warn('removing unsuppported microseconds', RuntimeWarning)
s = s[:s.index(".")]
return _strptime(s, fmt)
Zetta Status Feed - Example Code
Written by Anthony Eden (
# We need the PySimpleSoap library (
# Make sure you see my change to PySimpleSoap in the file ""
from pysimplesoap.client import SoapClient
# Connect to the Status Feed - make sure you put in the correct IP address
client = SoapClient(
wsdl = "",
trace = True
# Get a list of stations
stations = client.GetStations()['GetStationsResult']
# Print the list of stations
print stations
# Print out all the metadata for each station
for station in stations:
stationId = station['Station']['ID']
print "STATION ID", stationId
print client.GetStationFull(stationId)['GetStationFullResult']['Metadata']

This comment has been minimized.

Copy link

SsgtS7ARK commented Sep 7, 2018

Hi Anthony,

Thank you for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.