module filehelper.jython_helper

Short summary

module pyenbc.filehelper.jython_helper

Hadoop uses a java implementation of Python: Jython. This provides provides helper around that.

source on GitHub

Functions

function

truncated documentation

download_java_standalone

download the standalone jython if it does not exists, we should version JYTHON_VERSION by default in order to …

get_java_cmd

return the java path

get_java_path

returns the java path :raises FileNotFoundError: if java is not found

get_jython_jar

This function assumes a file jython-standalone-x.x.x.jar is present in this directory, the function returns the …

is_java_installed

Checks if :epkg:`java` is installed.

run_jython

runs a jython script and returns the standard output and error

Documentation

Hadoop uses a java implementation of Python: Jython. This provides provides helper around that.

source on GitHub

pyenbc.filehelper.jython_helper.download_java_standalone(version='2.7.1-rc2')[source]

download the standalone jython if it does not exists, we should version JYTHON_VERSION by default in order to fit the cluster’s version

Parameters

versionJYTHON_VERSION or …

Returns

path to it

source on GitHub

pyenbc.filehelper.jython_helper.get_java_cmd()[source]

return the java path

Returns

java cmd

source on GitHub

pyenbc.filehelper.jython_helper.get_java_path()[source]

returns the java path

Raises

FileNotFoundError – if java is not found

source on GitHub

pyenbc.filehelper.jython_helper.get_jython_jar()[source]

This function assumes a file jython-standalone-x.x.x.jar is present in this directory, the function returns the file.

Returns

absolute path

source on GitHub

pyenbc.filehelper.jython_helper.is_java_installed(fLOG=<function noLOG>)[source]

Checks if :epkg:`java` is installed.

Returns

boolean

source on GitHub

pyenbc.filehelper.jython_helper.run_jython(pyfile, argv=None, jython_path=None, sin=None, timeout=None, fLOG=<function noLOG>)[source]

runs a jython script and returns the standard output and error

Parameters
  • pyfile – jython file

  • argv – arguments to sned to the command line

  • jython_path – path to jython standalone

  • sin – data to send to the standard input

  • timeout – timeout

  • fLOG – logging function

Returns

out, err

If jython_path is None, the function looks into this directory.

source on GitHub