I was trying to use the openHistorian API to read some data and output it to the terminal. I copied the readTest.py from the GitHub and I ran into a couple errors.
D:\DCS\Scripts>python readTest.py
Connecting to openHistorian…
Opening “PPA” database instance…
Requesting metadata from openHistorian…
Received 1,396,137 bytes of metadata in 1.34 seconds. Decompressing…
Decompressed 11,396,927 bytes of metadata in 0.34 seconds. Parsing…
Parsed 23,495 metadata records in 0.81 seconds.
Discovered:
20,978 measurement records
347 device records, and
2,170 phasor records
Queried 21 metadata records associated with “PPA” database instance.
D:\DCS\Scripts\readTest.py:73: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in
** a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).**
** endTime = datetime.utcnow() - timedelta(seconds = 10)**
Starting read for 21 points from 2024-11-06 21:21:51.273281 to 2024-11-06 21:21:51.306281…
Failed to connect: unsupported type for timedelta microseconds component: numpy.uint64
Traceback (most recent call last):
File “D:\DCS\Scripts\readTest.py”, line 108, in
readTest()
~~~~~~~~^^
File “D:\DCS\Scripts\readTest.py”, line 83, in readTest
instance.Dispose()
~~~~~~~~~~~~~~~~^^
File “C:\Users\jmcmanus\AppData\Roaming\Python\Python313\site-packages\snapDB\snapClientDatabase.py”, line 220, in Dis
pose
Server.ValidateExpectedReadResponse(self.stream, ServerResponse.DATABASEDISCONNECTED)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\jmcmanus\AppData\Roaming\Python\Python313\site-packages\snapDB_init_.py”, line 60, in ValidateExpect
edReadResponse
Server.ValidateExpectedResponse(Server.ReadResponse(stream), expectedResponse)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\jmcmanus\AppData\Roaming\Python\Python313\site-packages\snapDB_init_.py”, line 44, in ValidateExpect
edResponse
raise RuntimeError(f"Unexpected server response: {response}")
RuntimeError: Unexpected server response: 128
Is this still the most up to date example of using the API to read?