Python library to communicate with varies systems such as Wood NEXUS IC, Maximo and OSI PI
Project description
pynexusic
pynexusic
is a package that allows communication with the following tools:
- Wood NEXUS IC
- Maximo
- OSI PI
Python library installation
pip install pynexusic
Library documentation
To be developed soon
External documentation
NEXUS IC
NEXUS IC REST API documentation can be found in the following link:
https://docs.nexusic.com/6.6/ic-web.rest.v2.html
A specific NEXUS IC version can be specified in the above link by changing 6.6 to the desired NEXUS IC version
OSI PI
OSI PI API documentation can be found in the following link:
https://techsupport.osisoft.com/Documentation/PI-Web-API/help.html
Maximo
Maximo API documentation can be found in the following link:
Examples
NEXUS IC Examples
-
Example 1: Get system version
-
Import
NEXUSIC_RESTAPI
from pynexusic import NEXUSIC_RESTAPI as api
-
Initialize
NEXUSIC_REST
classNX_REST = api.NEXUSIC_REST(baseURI, api_key=APIKey)
where APIKey is the user's API Key provided by the system administrator
-
Execute required function
result, result_status_code = NX_REST.getVersion()
Output:
result = {'version': 'x.x.xxxxx.x', 'schema': 'x.xxx'} result_code = 200
-
-
Example 2: Run reports and get python object response
-
Import
NEXUSIC_RESTAPI
from pynexusic import NEXUSIC_RESTAPI as api
-
Initialize
NEXUSIC_REST
classNX_REST = api.NEXUSIC_REST(baseURI, api_key=APIKey)
where APIKey is the user's API Key provided by the system administrator
-
Execute required report
result, result_status_code = NX_REST.getDashboard(report_name)
where report_name is the name of the report to be executed in NEXUS IC
Output:
result = {'name': 'xxxxxxxxxxx', 'elements': [{'type': 'section', 'data': {}}, {'type': 'paragraph', 'data': {'text': [{'value': 'xxxxxx'}]}} ] } result_code = 200
The values of the elements key will contain the data configured in the NEXUS IC report template
-
OSI PI Examples
-
Example 1: Get full list of points in the database
-
Import
OSIPI_WebAPI
from pynexusic import OSIPI_WebAPI as OSIPI
-
Initialize
OSIPI_WebAPI
classOSIPI_obj = OSIPI.OSIPI_WebAPI(piwebapi_uri, username, password)
an example for piwebapi_uri is https://[domain].com/piwebapi
-
Execute required function
result, result_status_code = OSIPI_obj.getPointsList(pageSize=20000)
Output:
result = [{'ServerName': 'xxxxxxxxxxx', 'Points': [{'WebId': 'xxxxxxxxxx', 'Id': xxxxx, ...}], 'ResponseStatus': 200 }] result_status_code = None
-
-
Example 2: Get stream summary data
-
Import
OSIPI_WebAPI
from pynexusic import OSIPI_WebAPI as OSIPI
-
Initialize
OSIPI_WebAPI
classOSIPI_obj = OSIPI.OSIPI_WebAPI(piwebapi_uri, username, password)
an example for piwebapi_uri is https://[domain].com/piwebapi
-
Execute required function
result, result_status_code = OSIPI_obj.getStreamDataSummary(webID, startTime='*-2mo', endTime='*-1mo', summaryType='Average')
where webID is the required stream webID, for more details see OSI PI documentation
Output:
result = {'Links': {}, 'Items': [{'Type': 'Average', 'Value': {'Timestamp': 'xxxxxxxx', 'Value': xxxxxx, ...} }] } result_status_code = 200
-
Maximo Examples
To be developed soon
Change history
(V2.1.8) Changes
- NEXUSIC_RESTAPI:
- Added
createNewAssets
function
- Added
(V2.1.7) Changes
- NEXUSIC_RESTAPI:
- Added
component_id
field in the event input dictionary increateNewEvents
function - Optimized
createNewEvents
function performance
- Added
(V2.1.6) Changes
- NEXUSIC_RESTAPI:
- Added the following arguments to
createNewEvents
function:sameAsset
sameWorkpack
sameEventType
sameSurveySet
- Fixed a bug in
createNewEvents
function to import continuous events
- Added the following arguments to
(V2.1.5) Changes
- NEXUSIC_RESTAPI:
- Added
getLookupListItem
function
- Added
(V2.1.4) Changes
- NEXUSIC_RESTAPI:
__init__.py
version import bug fix
(V2.1.3) Changes
- NEXUSIC_RESTAPI:
- Added the ability to get multiple pages in the
getTable
function - Removed
current_attempt
arugment from:- getAssetLocationByName
- getAssetLocationByID
- getAssetChildren
- getAssetTypesID
- getTableDBNames
- getAssetByFullLocation
- getTableDefInfo
- Added the ability to get multiple pages in the
(V2.1.2) Changes
- NEXUSIC_RESTAPI:
- Added
getAssetByFullLocation
function - Added
getTableDefInfo
function - Added
createNewEvents
function
- Added
- OSIPI_WebAPI:
- Added docstring
- MAXIMO_API:
- Added docstring
(V2.1.1) Changes:
- OSIPI_WebAPI:
- Added the ability to retrieve multiple AssetServers and DataServers in
get_system_links
function - Added the ability to get points list for a specific DataServer in
getPointsList
function.
- Added the ability to retrieve multiple AssetServers and DataServers in
(V2.1.0) Changes:
- NEXUSIC_RESTAPI:
- Added
createNewRecord
function
- Added
- MAXIMO_RESTAPI:
- Added read only connector class
- OSIPI_WebAPI:
- Added read only connector class
(V2.0.5) Changes:
- NEXUSIC_RESTAPI:
- Improved disconnection error handler
getAssetChildren
function: Added the ability to search at a specific level- Added
getAssetTypesID
function - Added
getTableDBNames
function
(V2.0.4) Changes:
- NEXUSIC_RESTAPI:
- Added
getAssetLocationByName
function - Added
getAssetLocationByID
function - Added
getAssetChildren
function
- Added
(V2.0.3) Changes:
- NEXUSIC_RESTAPI:
- Added the ability to authenticate using two modes (APIKEY and BASIC)
- APIKEY: Requires an API Key to authenticate
- BASIC: Requires username and password
- Added the ability to authenticate using two modes (APIKEY and BASIC)
(V2.0.2) Changes:
- NEXUSIC_RESTAPI:
- Added the ability to bypass SSL verification
(V2.0.1) Changes:
- Initial deployment in pypi.org
License
This project is licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file pynexusic-2.1.8-py3-none-any.whl
.
File metadata
- Download URL: pynexusic-2.1.8-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 731834a8a4bfb2eb24f380e68d3569009fe63232487f2fedb7fb4b416b909b44 |
|
MD5 | bc16bc19adc6ae7f7c66c4d271e6a914 |
|
BLAKE2b-256 | 8fd80021eb8fcea06447bd823047482fdf07364fa8000c5956acf1f19ea5a933 |