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
- Documentum
Python library installation
pip install pynexusic
Library documentation
-
Import
utilsfrom pynexusic import utils
-
Launch documentation
utils.launchDocs()
External documentation
NEXUS IC
NEXUS IC REST API documentation can be found in the following link:
https://docs.nexusic.com/6.7/ic-web.rest.v2.html
A specific NEXUS IC version can be specified in the above link by changing 6.7 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_RESTAPIfrom pynexusic import NEXUSIC_RESTAPI as api
-
Initialize
NEXUSIC_RESTclassNX_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_RESTAPIfrom pynexusic import NEXUSIC_RESTAPI as api
-
Initialize
NEXUSIC_RESTclassNX_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_WebAPIfrom pynexusic import OSIPI_WebAPI as OSIPI
-
Initialize
OSIPI_WebAPIclassOSIPI_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_WebAPIfrom pynexusic import OSIPI_WebAPI as OSIPI
-
Initialize
OSIPI_WebAPIclassOSIPI_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
Documentum Examples
-
Example 1: Getting all repositories
-
Import
DOCUMENTUM_APIfrom pynexusic import DOCUMENTUM_API as api
-
Initialize
DOCUMENTUM_APIclassdoc_api = api.DOCUMENTUM_API(url, username=username, password=password, verbose=True)
-
Getting all repositories
repos = doc_api.get_repositories()
Output:
repos = [{'id': 'xxxx', 'title': 'xxxx' ...} ... ]
-
-
Example 2: Getting a specific repositories
-
Import
DOCUMENTUM_APIfrom pynexusic import DOCUMENTUM_API as api
-
Initialize
DOCUMENTUM_APIclassdoc_api = api.DOCUMENTUM_API(url, username=username, password=password, verbose=True)
-
Getting a specific repositories
repo = doc_api.get_repository(repo_name)
where repo_name is the name of the report to be extracted from Documentum
Output:
repo = {'id': 'xxxx', 'title': 'xxxx' ...}
-
Change history
(V2.5.5) Changes
- NEXUSIC_RESTAPI:
- Optimized
createNewAssetsfunction
- Optimized
(V2.5.4) Changes
- NEXUSIC_RESTAPI:
- Modified
getChangeLogfunction to check Columns_Changed field if it is a valid XML - Added
allowCachingproperty to theNEXUSIC_RESTclass
- Modified
- Utils:
- Added
isXMLValidfunction
- Added
(V2.5.3) Changes
- NEXUSIC_RESTAPI:
- Added the ability to filter by GUID in
getChangeLogfunction
- Added the ability to filter by GUID in
(V2.5.2) Changes
- NEXUSIC_RESTAPI:
- Add logging and verbose information in
getChangeLogfunction
- Add logging and verbose information in
(V2.5.1) Changes
- NEXUSIC_RESTAPI:
- Added
getChangeLogfunction to allow user to pull data changes from the NEXUS IC database
- Added
(V2.5.0) Changes
- NEXUSIC_RESTAPI:
- Added
createLinkedAssetsfunction to allow user to created linked assets in the NEXUS IC database - Modified
createNewAssetsfunction to bypass asset type if not included in the input dictionary - Created
AssetNodeclass to allow usage of graph algorithms to represent Asset Hierarchy. Only implemented for NEXUSIC - Added
addGraphAssetfunction to all users add an asset to the graph data structure. Implemented following Depth-first search algorithm - Rewrote
getAssetByFullLocationfunction to avoid using the Full_Location as an API call query parameter and implemented the solution using graph algorithms
- Added
(V2.4.3) Changes
- NEXUSIC_RESTAPI:
- Added response status code 204 to
validate_and_return_responsefunction
- Added response status code 204 to
- MAXIMO_API:
- Added response status code 204 to
validate_and_return_responsefunction
- Added response status code 204 to
- OSIPI_WebAPI:
- Added response status code 204 to
validate_and_return_responsefunction
- Added response status code 204 to
- DOCUMENTUM_API:
- Added response status code 204 to
validate_and_return_responsefunction
- Added response status code 204 to
- Utils:
- Added Utils to documentation
(V2.4.2) Changes
- NEXUSIC_RESTAPI:
- Fixed a bug with logger level
(V2.4.1) Changes
- NEXUSIC_RESTAPI:
- Fixed the reference to the utils file
- MAXIMO_API:
- Fixed the reference to the utils file
- OSIPI_WebAPI:
- Fixed the reference to the utils file
- DOCUMENTUM_API:
- Fixed the reference to the utils file
(V2.4.0) Changes
- Utils:
- Added
setup_loggerfunction to setup logger - Added
print_logfunction to print to console and log file
- Added
- NEXUSIC_RESTAPI:
- Replaced all
printstatements withutils.print_log - Removed
self.verbosefrom all functions
- Replaced all
- MAXIMO_API:
- Replaced all
printstatements withutils.print_log - Removed
self.verbosefrom all functions
- Replaced all
- OSIPI_WebAPI:
- Replaced all
printstatements withutils.print_log - Removed
self.verbosefrom all functions
- Replaced all
- DOCUMENTUM_API:
- Replaced all
printstatements withutils.print_log - Removed
self.verbosefrom all functions
- Replaced all
(V2.3.11) Changes
- NEXUSIC_RESTAPI:
- Fixed a bug in
getLookupListItemfunction
- Fixed a bug in
(V2.3.10) Changes
- MAXIMO_API:
- Fixed a bug in the
MAXAUTHauthentication method
- Fixed a bug in the
(V2.3.9) Changes
- MAXIMO_API:
- Added
MAXAUTHas another authentication method
- Added
(V2.3.8) Changes
- MAXIMO_API:
- Added the ability to decide whether to skip SSL verification during authentication
(V2.3.7) Changes
- NEXUSIC_RESTAPI:
- Changed the error handler for the
validate_and_return_responsefunction to raise an Exception instead of returning a string - In the
getLookupListItemfunction: Added the ability to pass the Lookup list name as a filter parameter
- Changed the error handler for the
(V2.3.6) Changes
- OSIPI_WebAPI:
- Improved
validate_and_return_responsefunction error handler
- Improved
(V2.3.5) Changes
- MAXIMO_API:
- Added
use_oslctooslc_update_recordfunction to allow using either oslc or rest in the Post call
- Added
(V2.3.4) Changes
- NEXUSIC_RESTAPI:
- Fixed a bug in
createNewRecordfunction
- Fixed a bug in
(V2.3.3) Changes
- MAXIMO_API:
- Added
oslc_create_new_recordfunction - Added
oslc_update_recordfunction - Added
mbo_exec_methodfunction
- Added
(V2.3.2) Changes
- Docs:
- Added library Sphinx docs
(V2.3.1) Changes
- MAXIMO_API:
- Added the ability to run API calls using _mif
- Added
mbo_update_recordfunction - Added
mbo_get_tablefunction
- DOCUMENTUM_API:
- Added new connector to DOCUMENTUM
(V2.2.1) Changes
- NEXUSIC_RESTAPI:
- Added
jobStatusfunction - Added
jobContentfunction - Added
importLibraryfunction
- Added
(V2.2.0) Changes
- NEXUSIC_RESTAPI:
- Added
generateReport_v2function - Added
get_rt_idfunction - Added
importRepositoryfunction - Added
importMultimediafunction - Updated
createNewEventsfunction to import events multimedia
- Added
- MAXIMO_API:
- Added
get_mx_wosfunction - Added
get_mx_srsfunction - Added
mxapi_post_requestfunction - Added
mbo_create_new_recordfunction - Renamed
get_tabletooslc_get_table
- Added
(V2.1.8) Changes
- NEXUSIC_RESTAPI:
- Added
createNewAssetsfunction
- Added
(V2.1.7) Changes
- NEXUSIC_RESTAPI:
- Added
component_idfield in the event input dictionary increateNewEventsfunction - Optimized
createNewEventsfunction performance
- Added
(V2.1.6) Changes
- NEXUSIC_RESTAPI:
- Added the following arguments to
createNewEventsfunction:sameAssetsameWorkpacksameEventTypesameSurveySet
- Fixed a bug in
createNewEventsfunction to import continuous events
- Added the following arguments to
(V2.1.5) Changes
- NEXUSIC_RESTAPI:
- Added
getLookupListItemfunction
- Added
(V2.1.4) Changes
- NEXUSIC_RESTAPI:
__init__.pyversion import bug fix
(V2.1.3) Changes
- NEXUSIC_RESTAPI:
- Added the ability to get multiple pages in the
getTablefunction - Removed
current_attemptarugment from:- getAssetLocationByName
- getAssetLocationByID
- getAssetChildren
- getAssetTypesID
- getTableDBNames
- getAssetByFullLocation
- getTableDefInfo
- Added the ability to get multiple pages in the
(V2.1.2) Changes
- NEXUSIC_RESTAPI:
- Added
getAssetByFullLocationfunction - Added
getTableDefInfofunction - Added
createNewEventsfunction
- 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_linksfunction - Added the ability to get points list for a specific DataServer in
getPointsListfunction.
- Added the ability to retrieve multiple AssetServers and DataServers in
(V2.1.0) Changes:
- NEXUSIC_RESTAPI:
- Added
createNewRecordfunction
- 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
getAssetChildrenfunction: Added the ability to search at a specific level- Added
getAssetTypesIDfunction - Added
getTableDBNamesfunction
(V2.0.4) Changes:
- NEXUSIC_RESTAPI:
- Added
getAssetLocationByNamefunction - Added
getAssetLocationByIDfunction - Added
getAssetChildrenfunction
- 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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynexusic-2.5.5.tar.gz.
File metadata
- Download URL: pynexusic-2.5.5.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ca51325e81a31255d533ffc17a30cfd8cb6c26f1fbd9c94da3efe66d8f6a753
|
|
| MD5 |
0036263058234ca2c0a4564a5b2494bf
|
|
| BLAKE2b-256 |
1958071f43c6652c541d87f26ae209d203d9368c6a25fa2e9aa0879f9f8a7150
|
File details
Details for the file pynexusic-2.5.5-py3-none-any.whl.
File metadata
- Download URL: pynexusic-2.5.5-py3-none-any.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18c2d817fe8ed340aa448bf4ad8c669fefbe42ea0c54c0077e9bee62cf455dab
|
|
| MD5 |
ef773409a9543b006e5f49736639dfc6
|
|
| BLAKE2b-256 |
1a315e6f7a6e2ef1079398fb39bf89a4cdec17712e1a30554db3c81c904a1471
|