Unofficial Python wrapper for the AVEVA Insight, formerly Wonderware Online InSight, Historian Data REST API.
Response data is returned as a pandas
DataFrame for quicker, easier manipulation and analysis.
Full documentation for the API can be found here.
- Fork/Clone/Download this repo:
https://github.com/dpkilcoyne/wonderware-API-python.git
- Navigate to the directory:
cd wonderware-API-python
- Install the dependencies:
pip install -r requirements.txt
- From AVEVA Insight, go to administration portal then select REST API under the Integration Settings cell.
- Select Basic Authentication and copy the endpoint URL.
- Enter your endpoint and account credentials into the WonderwareAPI constructor:
from wonderware import WonderwareAPI
endpoint = "YOUR_ENDPOINT"
username = "YOUR_USERNAME"
password = "YOUR_PASSWORD"
wonderware = WonderwareAPI(endpoint, username, password)
More examples can be found in the examples directory
wonderware = WonderwareAPI(endpoint, username, password)
start_time = "2019-11-23T00:00:00.000Z"
end_time = "2019-11-26T00:00:00.000Z"
resolution = 60000
tags = ['YOUR_TAG_1', 'YOUR_TAG_2']
df = wonderware.analog_summary(tags, start_time, end_time, resolution)
wonderware.dir = r'C:\Users\home\target_directory' # Use this directory for the entire project, otherwise, will use working dir
wonderware.save_to_csv(df, 'YOUR_FILENAME.csv')
- Analog summary requests
- Process values requests
- Historian Data REST API responses are paginated with a maximum of of 5000 records. wonderware-API-python makes all
the requests from
start_time
toend_time
and returns a single DataFrame that's appended all the paginated responses. - DateTime values are formatted as
pandas.Timestamp
objects with ns units. - All DateTime values are returned in UTC, then non-localized so reading/writing from storage remains consistent.
resolution
is in milliseconds.resolution=86400000
will return data with a resolution of 1 day (useful to get the min, max, avg, etc. of the day)
Daniel Kilcoyne dkilcoyne@cambrianinnovation.com
- The source code is licensed under GPL v3. License is available here
- Copyright 2019 © Cambrian Innovation.