AnsweredAssumed Answered

Python PI Web API library - search points by tag name, pull data with results

Question asked by Ckoshnick on Sep 24, 2018
Latest reply on Sep 24, 2018 by Ckoshnick

Hello! I have a question regarding the use of the Python library for the PI web API (Announcing PI Web API client library for Python )

 

Our office has used our own Python library to access the PI web API with just a few functions. Our main strategy was to use a tag name query to return the webIDs then use the webIDs to get data. The search URL followed the following syntax: root / dataserver / <dataserver> / points?nameFilter= <point query> where <point query> would be a search string for PI Point tag names that supports wild-carding with *. Generally, we would return the webID and tagName with the using the following params = {"selectedFields": "Items.WebId;Items.Name"} in the web request. Our data getting method used the following structure root / streams /  <Web_ID> /  <calculation> which would return a json that we parsed into a pd.DataFrame.

 

My question is how to use the osisoft.pidevclub.piwebapi.pi_web_api_client to do a similar thing. Most of the documentation shows data get requests using the webID or Path conventions, but I can't find a function to let me search for WebIDs. Is there a method for obtaining webIDs by searching tag names as I explained above?

 

>>client.system.versions()

{'OSIsoft.REST': {'build': '478',

  'full_version': '1.9.0.478',

  'major_minor_revision': '1.9.0',

  'web_exception': None}, 'OSIsoft.REST.Documentation': {'build': '478',

  'full_version': '1.9.0.478',

  'major_minor_revision': '1.9.0',

  'web_exception': None}, 'OSIsoft.Search.SvcLib': {'build': '2561',

  'full_version': '1.6.0.2561',

  'major_minor_revision': '1.6.0',

  'web_exception': None}}

 

Thanks!

Outcomes