API Reference¶
PIconnect Connector to the OSISoft PI and PI-AF databases.
- class PIconnect.PIAFDatabase(server: str | None = None, database: str | None = None)¶
Bases:
object
Context manager for connections to the PI Asset Framework database.
- property children: Dict[str, PIAFElement]¶
Return a dictionary of the direct child elements of the database.
- database: AFDatabase¶
- default_server: Dict[str, PISystem | Dict[str, AFDatabase]] | None = {'databases': {'TestDatabase': <PIconnect._typing.AF.AFDatabase object>}, 'server': <PIconnect._typing.AF.PISystem object>}¶
- descendant(path: str) PIAFElement ¶
Return a descendant of the database from an exact path.
- event_frames(start_time: str | datetime = '', start_index: int = 0, max_count: int = 1000, search_mode: EventFrameSearchMode = EventFrameSearchMode.FORWARD_FROM_START_TIME, search_full_hierarchy: bool = False) Dict[str, PIAFEventFrame] ¶
- search(query: str | List[str]) List[PIAFAttribute] ¶
return a list of PIAFAttributes directly from a list of element|attribute path strings
like this:
list(“BaseElement/childElement/childElement|Attribute|ChildAttribute|ChildAttribute”, “BaseElement/childElement/childElement|Attribute|ChildAttribute|ChildAttribute”)
- server: PISystem¶
- servers: Dict[str, Dict[str, PISystem | Dict[str, AFDatabase]]] = {'TestingAF': {'databases': {'TestDatabase': <PIconnect._typing.AF.AFDatabase object>}, 'server': <PIconnect._typing.AF.PISystem object>}}¶
- version = '0.2.0'¶
- class PIconnect.PIServer(server: str | None = None, username: str | None = None, password: str | None = None, domain: str | None = None, authentication_mode: AuthenticationMode = AuthenticationMode.PI_USER_AUTHENTICATION, timeout: int | None = None)¶
Bases:
object
PIServer is a connection to an OSIsoft PI Server
- Parameters:
Note
If the specified server is unknown a warning is thrown and the connection is redirected to the default server, as if no server was passed. The list of known servers is available in the PIServer.servers dictionary.
- default_server = <PIconnect._typing.PI.PIServer object>¶
Default server, as reported by the SDK
- search(query: str | List[str], source: str | None = None) List[PIPoint] ¶
Search PIPoints on the PIServer
- Parameters:
- Returns:
A list of
PIPoint
objects as a result of the query- Return type:
Todo
Reject searches while not connected
- property server_name¶
Name of the connected server
- servers = {'Testing': <PIconnect._typing.PI.PIServer object>}¶
Dictionary of known servers, as reported by the SDK
- version = '0.2.2'¶
Generic utility modules¶
- PIconnect.AFSDK module
- PIconnect.PIConsts module
AuthenticationMode
BufferMode
CalculationBasis
EventFrameSearchMode
EventFrameSearchMode.BACKWARD_FROM_END_TIME
EventFrameSearchMode.BACKWARD_FROM_START_TIME
EventFrameSearchMode.BACKWARD_IN_PROGRESS
EventFrameSearchMode.ENDING_AFTER
EventFrameSearchMode.ENDING_BEFORE
EventFrameSearchMode.FORWARD_FROM_END_TIME
EventFrameSearchMode.FORWARD_FROM_START_TIME
EventFrameSearchMode.FORWARD_IN_PROGRESS
EventFrameSearchMode.NONE
EventFrameSearchMode.STARTING_AFTER
EventFrameSearchMode.STARTING_AFTER_IN_PROGRESS
EventFrameSearchMode.STARTING_BEFORE
EventFrameSearchMode.STARTING_BEFORE_IN_PROGRESS
ExpressionSampleType
RetrievalMode
SummaryType
TimestampCalculation
UpdateMode
- PIconnect.PIData module
PISeriesContainer
PISeriesContainer.current_value
PISeriesContainer.filtered_summaries()
PISeriesContainer.interpolated_value()
PISeriesContainer.interpolated_values()
PISeriesContainer.name
PISeriesContainer.recorded_value()
PISeriesContainer.recorded_values()
PISeriesContainer.summaries()
PISeriesContainer.summary()
PISeriesContainer.units_of_measurement
PISeriesContainer.update_value()
PISeriesContainer.version
- PIconnect.config module
- PIconnect.time module