Installing pure Python modules - 3.12

Data360 Analyze Server Help

Product
Data360 Analyze
Version
3.12
Language
English
Portfolio
Verify
Product family
Data360
Product name
Data360 Analyze
Title
Data360 Analyze Server Help
Copyright
2023
First publish date
2016

You can add a pure Python module to your Data360 Analyze installation to use in Python-based nodes, for example the Generate Data node or the Transform node.

Note: The following steps do not apply to NumPy or SciPy as these modules are not pure Python. Only pure Python modules can be installed, other third-party libraries are not supported.

Install the required Python module:

Adding a pure Python module on Windows server
  1. Run Windows Command Prompt as an administrator.
  2. Run the following command, replacing <Data360AnalyzeInstallDirectory> with the location where Data360 Analyze is installed, <Data360AnalyzeSiteDirectory> with the location of the site configuration directory and <module> with the name of the Python module that you want to install:

    "<Data360AnalyzeInstallDirectory>\platform\windows-x86-64\jython\bin\pip" install <module> --target <Data360AnalyzeSiteDirectory>\site-7731\lib\jython2

    For example:

    "C:\Program Files\Data360Analyze\platform\windows-x86-64\jython\bin\pip" install httplib2 --target C:\Users\ExampleUser\Data360Analyze\site-7731\lib\jython2

Adding a pure Python module on Unix
  1. Run the following command, replacing <Data360AnalyzeInstallDirectory> with the location where Data360 Analyze is installed, <Data360AnalyzeSiteDirectory> with the location of the site configuration directory and <module> with the name of the Python module that you want to install:

    <Data360AnalyzeInstallDirectory>/platform/linux-x86-64/jython/bin/pip install <module> --target <Data360AnalyzeSiteDirectory>/site-7733/lib/jython2

Configure and run the Python-based node, for example the Generate Data or Transform node. The following example shows how to import the httplib2 module:
  1. In the ConfigureFields property, enter the following:
    from httplib2 import Http
    out1.responseName = unicode
    out1.responseValue = unicode
  2. In the CreateRecords property, enter the following:
    h = Http()
    resp, content = h.request("http://www.google.com")
    out1.responseName = 'status'
    out1.responseValue = resp['status']
    node.write(0,out1)
    out1.responseName = 'content-type'
    out1.responseValue = resp['content-type']
    node.write(0,out1)