org.jpy (Java-Python Bridge 0.9-SNAPSHOT Java API)
Date: 2017-05-04

# Package org.jpy

Provides the classes necessary to create an embedded Python VM, to execute Python code, to import Python modules, to access Python variables, and finally to call Python functions and class methods.

See: Description

- Class Summary
  Class | Description
  --- | ---
  DL | A replacement for `System.load(String)` with support for POSIX `dlopen` flags.
  PyLib | Represents the library that provides the Python interpreter (CPython).
  PyLib.Diag | Controls output of diagnostic information for debugging.
  PyModule | Represents a Python module.
  PyObject | Represents a Python object (of Python/C API type `PyObject*`) in the Python interpreter.

- Enum Summary
  Enum | Description
  --- | ---
  PyInputMode | Source code input modes for compiling/executing Python source code.
  PyLib.CallableKind | The kind of callable Python objects.

## Package org.jpy Description

Provides the classes necessary to

1. create an embedded Python VM,
2. to execute Python code,
3. to import Python modules,
4. to access Python variables, and finally
5. to call Python functions and class methods.

The entry point to the jpy Java API is the `PyLib` class which is used to either detect an already running Python interpreter or to start a new one:

         if (!PyLib.isPythonRunning()) {
             PyLib.startPython(opt1, opt2, ...);
         }

jpy API clients should first call `PyLib.isPythonRunning()` in order to check if a Python interpreter is already available. If not, `PyLib.startPython(String...)` must be called before any other jpy API is used.

Once the Python interpreter in running clients can either execute Python code directly using the `PyLib.execScript(String)` method or load a Python module using `PyModule.importModule(String)`. The returned `PyModule` object then is the entry point to access Python variables and invoke functions.

Some `PyModule` methods return `PyObject` instances. These can be used to create instances of Python classes, and to access Python class members, attributes and to invoke Python object methods..

Since:
  0.7

Copyright © 2014–2017 Brockmann Consult GmbH. All rights reserved.