Listening for Changes
The Volue Insight Timeseries API supports listening for changes to curves. An event listener behaves like an infinite iterator, returning change events as they happen.
Setting up a listener
Section titled βSetting up a listenerβFind a list of curves (or curve IDs) and pass them to session.events().
Two optional arguments are available:
start_timeβ resume a listener without receiving old eventstimeoutβ stop waiting after the specified number of seconds
When a curve is updated, the iterator yields a CurveEvent object.
If timeout is specified and expires, an EventTimeout object is returned.
>>> curves = session.search(category='WND', area=['EE', 'LT'], frequency='H')>>> events = session.events(curves, timeout=5)>>> for e in events:... print(e)See the listening for changes example for a complete script that appends new data to a CSV file on each event.
Was this page helpful?Thanks for your feedback!