Skip to main content

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:

https://www.ibm.com/support/knowledgecenter/SS8CCV_7.6.0.8/com.ibm.mams.doc/overview/c_product_overview.html

Examples

NEXUS IC Examples

  • Example 1: Get system version

    1. Import NEXUSIC_RESTAPI

      from pynexusic import NEXUSIC_RESTAPI as api
      
    2. Initialize NEXUSIC_REST class

      NX_REST = api.NEXUSIC_REST(baseURI, api_key=APIKey)
      

      where APIKey is the user's API Key provided by the system administrator

    3. 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

    1. Import NEXUSIC_RESTAPI

      from pynexusic import NEXUSIC_RESTAPI as api
      
    2. Initialize NEXUSIC_REST class

      NX_REST = api.NEXUSIC_REST(baseURI, api_key=APIKey)
      

      where APIKey is the user's API Key provided by the system administrator

    3. 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

    1. Import OSIPI_WebAPI

      from pynexusic import OSIPI_WebAPI as OSIPI
      
    2. Initialize OSIPI_WebAPI class

      OSIPI_obj = OSIPI.OSIPI_WebAPI(piwebapi_uri, username, password)
      

      an example for piwebapi_uri is https://[domain].com/piwebapi

    3. 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

    1. Import OSIPI_WebAPI

      from pynexusic import OSIPI_WebAPI as OSIPI
      
    2. Initialize OSIPI_WebAPI class

      OSIPI_obj = OSIPI.OSIPI_WebAPI(piwebapi_uri, username, password)
      

      an example for piwebapi_uri is https://[domain].com/piwebapi

    3. 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.6) Changes

  • NEXUSIC_RESTAPI:
    1. Added the following arguments to createNewEvents function:
      • sameAsset
      • sameWorkpack
      • sameEventType
      • sameSurveySet
    2. Fixed a bug in createNewEvents function to import continuous events

(V2.1.5) Changes

  • NEXUSIC_RESTAPI:
    1. Added getLookupListItem function

(V2.1.4) Changes

  • NEXUSIC_RESTAPI:
    1. __init__.py version import bug fix

(V2.1.3) Changes

  • NEXUSIC_RESTAPI:
    1. Added the ability to get multiple pages in the getTable function
    2. Removed current_attempt arugment from:
      • getAssetLocationByName
      • getAssetLocationByID
      • getAssetChildren
      • getAssetTypesID
      • getTableDBNames
      • getAssetByFullLocation
      • getTableDefInfo

(V2.1.2) Changes

  • NEXUSIC_RESTAPI:
    1. Added getAssetByFullLocation function
    2. Added getTableDefInfo function
    3. Added createNewEvents function
  • OSIPI_WebAPI:
    1. Added docstring
  • MAXIMO_API:
    1. Added docstring

(V2.1.1) Changes:

  • OSIPI_WebAPI:
    1. Added the ability to retrieve multiple AssetServers and DataServers in get_system_links function
    2. Added the ability to get points list for a specific DataServer in getPointsList function.

(V2.1.0) Changes:

  • NEXUSIC_RESTAPI:
    1. Added createNewRecord function
  • MAXIMO_RESTAPI:
    1. Added read only connector class
  • OSIPI_WebAPI:
    1. Added read only connector class

(V2.0.5) Changes:

  • NEXUSIC_RESTAPI:
    1. Improved disconnection error handler
    2. getAssetChildren function: Added the ability to search at a specific level
    3. Added getAssetTypesID function
    4. Added getTableDBNames function

(V2.0.4) Changes:

  • NEXUSIC_RESTAPI:
    1. Added getAssetLocationByName function
    2. Added getAssetLocationByID function
    3. Added getAssetChildren function

(V2.0.3) Changes:

  • NEXUSIC_RESTAPI:
    1. Added the ability to authenticate using two modes (APIKEY and BASIC)
      • APIKEY: Requires an API Key to authenticate
      • BASIC: Requires username and password

(V2.0.2) Changes:

  • NEXUSIC_RESTAPI:
    1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynexusic-2.1.6.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynexusic-2.1.6-py2-none-any.whl (17.0 kB view details)

Uploaded Python 2

File details

Details for the file pynexusic-2.1.6.tar.gz.

File metadata

  • Download URL: pynexusic-2.1.6.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for pynexusic-2.1.6.tar.gz
Algorithm Hash digest
SHA256 0e51dd0a66ac110996267aca859ed3c3674b7949007dcdbc76aa135498ecdb66
MD5 31d8899fbfc700c80d83736e6854808d
BLAKE2b-256 5a7c6819736b371200d40d8ebfdc4eace5029a1f1b72ca78140a2b9fd7899463

See more details on using hashes here.

File details

Details for the file pynexusic-2.1.6-py2-none-any.whl.

File metadata

  • Download URL: pynexusic-2.1.6-py2-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for pynexusic-2.1.6-py2-none-any.whl
Algorithm Hash digest
SHA256 87c91d1c81ab9a4006fc250179479cd3129d03a05a5df9aba2e8f7bba64f05a9
MD5 eee99dcc91ad9fef45454efc56dff0a9
BLAKE2b-256 5300c0f67104928b44d12399cb5b9fce2261ade15b9e4f1d98d9c34adf51d04b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page