Package: pynexusic
pynexusicpynexusicis a package that allows communication with the following tools:Wood NEXUS ICMaximoOSI PIDocumentumPython library installationpipinstallpynexusicLibrary documentationImportutilsfrompynexusicimportutilsLaunch documentationutils.launchDocs()External documentationNEXUS ICNEXUS IC REST API documentation can be found in the following link:https://docs.nexusic.com/6.7/ic-web.rest.v2.htmlA specific NEXUS IC version can be specified in the above link by changing6.7to the desired NEXUS IC versionOSI PIOSI PI API documentation can be found in the following link:https://techsupport.osisoft.com/Documentation/PI-Web-API/help.htmlMaximoMaximo API documentation can be found in the following link:https://www.ibm.com/support/knowledgecenter/SS8CCV_7.6.0.8/com.ibm.mams.doc/overview/c_product_overview.htmlExamplesNEXUS IC ExamplesExample 1: Get system versionImportNEXUSIC_RESTAPIfrompynexusicimportNEXUSIC_RESTAPIasapiInitializeNEXUSIC_RESTclassNX_REST=api.NEXUSIC_REST(baseURI,api_key=APIKey)whereAPIKeyis the user's API Key provided by the system administratorExecute required functionresult,result_status_code=NX_REST.getVersion()Output:result={'version':'x.x.xxxxx.x','schema':'x.xxx'}result_code=200Example 2: Run reports and get python object responseImportNEXUSIC_RESTAPIfrompynexusicimportNEXUSIC_RESTAPIasapiInitializeNEXUSIC_RESTclassNX_REST=api.NEXUSIC_REST(baseURI,api_key=APIKey)whereAPIKeyis the user's API Key provided by the system administratorExecute required reportresult,result_status_code=NX_REST.getDashboard(report_name)wherereport_nameis the name of the report to be executed in NEXUS ICOutput:result={'name':'xxxxxxxxxxx','elements':[{'type':'section','data':{}},{'type':'paragraph','data':{'text':[{'value':'xxxxxx'}]}}]}result_code=200The values of theelementskey will contain the data configured in the NEXUS IC report templateOSI PI ExamplesExample 1: Get full list of points in the databaseImportOSIPI_WebAPIfrompynexusicimportOSIPI_WebAPIasOSIPIInitializeOSIPI_WebAPIclassOSIPI_obj=OSIPI.OSIPI_WebAPI(piwebapi_uri,username,password)an example forpiwebapi_uriis https://[domain].com/piwebapiExecute required functionresult,result_status_code=OSIPI_obj.getPointsList(pageSize=20000)Output:result=[{'ServerName':'xxxxxxxxxxx','Points':[{'WebId':'xxxxxxxxxx','Id':xxxxx,...}],'ResponseStatus':200}]result_status_code=NoneExample 2: Get stream summary dataImportOSIPI_WebAPIfrompynexusicimportOSIPI_WebAPIasOSIPIInitializeOSIPI_WebAPIclassOSIPI_obj=OSIPI.OSIPI_WebAPI(piwebapi_uri,username,password)an example forpiwebapi_uriis https://[domain].com/piwebapiExecute required functionresult,result_status_code=OSIPI_obj.getStreamDataSummary(webID,startTime='*-2mo',endTime='*-1mo',summaryType='Average')wherewebIDis the required stream webID, for more details see OSI PI documentationOutput:result={'Links':{},'Items':[{'Type':'Average','Value':{'Timestamp':'xxxxxxxx','Value':xxxxxx,...}}]}result_status_code=200Maximo ExamplesTo be developed soonDocumentum ExamplesExample 1: Getting all repositoriesImportDOCUMENTUM_APIfrompynexusicimportDOCUMENTUM_APIasapiInitializeDOCUMENTUM_APIclassdoc_api=api.DOCUMENTUM_API(url,username=username,password=password,verbose=True)Getting all repositoriesrepos=doc_api.get_repositories()Output:repos=[{'id':'xxxx','title':'xxxx'...}...]Example 2: Getting a specific repositoriesImportDOCUMENTUM_APIfrompynexusicimportDOCUMENTUM_APIasapiInitializeDOCUMENTUM_APIclassdoc_api=api.DOCUMENTUM_API(url,username=username,password=password,verbose=True)Getting a specific repositoriesrepo=doc_api.get_repository(repo_name)whererepo_nameis the name of the report to be extracted from DocumentumOutput:repo={'id':'xxxx','title':'xxxx'...}Change history(V2.5.5) ChangesNEXUSIC_RESTAPI:OptimizedcreateNewAssetsfunction(V2.5.4) ChangesNEXUSIC_RESTAPI:ModifiedgetChangeLogfunction to check Columns_Changed field if it is a valid XMLAddedallowCachingproperty to theNEXUSIC_RESTclassUtils:AddedisXMLValidfunction(V2.5.3) ChangesNEXUSIC_RESTAPI:Added the ability to filter by GUID ingetChangeLogfunction(V2.5.2) ChangesNEXUSIC_RESTAPI:Add logging and verbose information ingetChangeLogfunction(V2.5.1) ChangesNEXUSIC_RESTAPI:AddedgetChangeLogfunction to allow user to pull data changes from the NEXUS IC database(V2.5.0) ChangesNEXUSIC_RESTAPI:AddedcreateLinkedAssetsfunction to allow user to created linked assets in the NEXUS IC databaseModifiedcreateNewAssetsfunction to bypass asset type if not included in the input dictionaryCreatedAssetNodeclass to allow usage of graph algorithms to represent Asset Hierarchy. Only implemented for NEXUSICAddedaddGraphAssetfunction to all users add an asset to the graph data structure. Implemented following Depth-first search algorithmRewrotegetAssetByFullLocationfunction to avoid using the Full_Location as an API call query parameter and implemented the solution using graph algorithms(V2.4.3) ChangesNEXUSIC_RESTAPI:Added response status code 204 tovalidate_and_return_responsefunctionMAXIMO_API:Added response status code 204 tovalidate_and_return_responsefunctionOSIPI_WebAPI:Added response status code 204 tovalidate_and_return_responsefunctionDOCUMENTUM_API:Added response status code 204 tovalidate_and_return_responsefunctionUtils:Added Utils to documentation(V2.4.2) ChangesNEXUSIC_RESTAPI:Fixed a bug with logger level(V2.4.1) ChangesNEXUSIC_RESTAPI:Fixed the reference to the utils fileMAXIMO_API:Fixed the reference to the utils fileOSIPI_WebAPI:Fixed the reference to the utils fileDOCUMENTUM_API:Fixed the reference to the utils file(V2.4.0) ChangesUtils:Addedsetup_loggerfunction to setup loggerAddedprint_logfunction  to print to console and log fileNEXUSIC_RESTAPI:Replaced allprintstatements withutils.print_logRemovedself.verbosefrom all functionsMAXIMO_API:Replaced allprintstatements withutils.print_logRemovedself.verbosefrom all functionsOSIPI_WebAPI:Replaced allprintstatements withutils.print_logRemovedself.verbosefrom all functionsDOCUMENTUM_API:Replaced allprintstatements withutils.print_logRemovedself.verbosefrom all functions(V2.3.11) ChangesNEXUSIC_RESTAPI:Fixed a bug ingetLookupListItemfunction(V2.3.10) ChangesMAXIMO_API:Fixed a bug in theMAXAUTHauthentication method(V2.3.9) ChangesMAXIMO_API:AddedMAXAUTHas another authentication method(V2.3.8) ChangesMAXIMO_API:Added the ability to decide whether to skip SSL verification during authentication(V2.3.7) ChangesNEXUSIC_RESTAPI:Changed the error handler for thevalidate_and_return_responsefunction to raise an Exception instead of returning a stringIn thegetLookupListItemfunction: Added the ability to pass the Lookup list name as a filter parameter(V2.3.6) ChangesOSIPI_WebAPI:Improvedvalidate_and_return_responsefunction error handler(V2.3.5) ChangesMAXIMO_API:Addeduse_oslctooslc_update_recordfunction to allow using either oslc or rest in the Post call(V2.3.4) ChangesNEXUSIC_RESTAPI:Fixed a bug increateNewRecordfunction(V2.3.3) ChangesMAXIMO_API:Addedoslc_create_new_recordfunctionAddedoslc_update_recordfunctionAddedmbo_exec_methodfunction(V2.3.2) ChangesDocs:Added library Sphinx docs(V2.3.1) ChangesMAXIMO_API:Added the ability to run API calls using _mifAddedmbo_update_recordfunctionAddedmbo_get_tablefunctionDOCUMENTUM_API:Added new connector to DOCUMENTUM(V2.2.1) ChangesNEXUSIC_RESTAPI:AddedjobStatusfunctionAddedjobContentfunctionAddedimportLibraryfunction(V2.2.0) ChangesNEXUSIC_RESTAPI:AddedgenerateReport_v2functionAddedget_rt_idfunctionAddedimportRepositoryfunctionAddedimportMultimediafunctionUpdatedcreateNewEventsfunction to import events multimediaMAXIMO_API:Addedget_mx_wosfunctionAddedget_mx_srsfunctionAddedmxapi_post_requestfunctionAddedmbo_create_new_recordfunctionRenamedget_tabletooslc_get_table(V2.1.8) ChangesNEXUSIC_RESTAPI:AddedcreateNewAssetsfunction(V2.1.7) ChangesNEXUSIC_RESTAPI:Addedcomponent_idfield in the event input dictionary increateNewEventsfunctionOptimizedcreateNewEventsfunction performance(V2.1.6) ChangesNEXUSIC_RESTAPI:Added the following arguments tocreateNewEventsfunction:sameAssetsameWorkpacksameEventTypesameSurveySetFixed a bug increateNewEventsfunction to import continuous events(V2.1.5) ChangesNEXUSIC_RESTAPI:AddedgetLookupListItemfunction(V2.1.4) ChangesNEXUSIC_RESTAPI:__init__.pyversion import bug fix(V2.1.3) ChangesNEXUSIC_RESTAPI:Added the ability to get multiple pages in thegetTablefunctionRemovedcurrent_attemptarugment from:getAssetLocationByNamegetAssetLocationByIDgetAssetChildrengetAssetTypesIDgetTableDBNamesgetAssetByFullLocationgetTableDefInfo(V2.1.2) ChangesNEXUSIC_RESTAPI:AddedgetAssetByFullLocationfunctionAddedgetTableDefInfofunctionAddedcreateNewEventsfunctionOSIPI_WebAPI:Added docstringMAXIMO_API:Added docstring(V2.1.1) Changes:OSIPI_WebAPI:Added the ability to retrieve multiple AssetServers and DataServers inget_system_linksfunctionAdded the ability to get points list for a specific DataServer ingetPointsListfunction.(V2.1.0) Changes:NEXUSIC_RESTAPI:AddedcreateNewRecordfunctionMAXIMO_RESTAPI:Added read only connector classOSIPI_WebAPI:Added read only connector class(V2.0.5) Changes:NEXUSIC_RESTAPI:Improved disconnection error handlergetAssetChildrenfunction: Added the ability to search at a specific levelAddedgetAssetTypesIDfunctionAddedgetTableDBNamesfunction(V2.0.4) Changes:NEXUSIC_RESTAPI:AddedgetAssetLocationByNamefunctionAddedgetAssetLocationByIDfunctionAddedgetAssetChildrenfunction(V2.0.3) Changes:NEXUSIC_RESTAPI:Added the ability to authenticate using two modes (APIKEY and BASIC)APIKEY: Requires an API Key to authenticateBASIC: Requires username and password(V2.0.2) Changes:NEXUSIC_RESTAPI:Added the ability to bypass SSL verification(V2.0.1) Changes:Initial deployment in pypi.orgLicenseThis project is licensed under the MIT license.