# 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

- Interface Summary
  Interface | Description
  --- | ---
  IdentityModule |

- Class Summary
  Class | Description
  --- | ---
  CreateModule |
  DL | A replacement for `System.load(String)` with support for POSIX `dlopen` flags.
  PyDictWrapper | A simple wrapper around PyObjects that are actually Python dictionaries, to present the most useful parts of a Map interface.
  PyLib | Represents the library that provides the Python interpreter (CPython).
  PyLib.Diag | Controls output of diagnostic information for debugging.
  PyLibInitializer | This helper class is to safely and programmatically configure jpy.
  PyListWrapper | A simple wrapper around a Python List object that implements a java List of PyObjects.
  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.

- Exception Summary
  Exception | Description
  --- | ---
  KeyError | Translation of Python KeyErrors so that they can be programmatically detected from Java.
  StopIteration | Translation of Python StopIteration so that they can be programmatically detected from Java.

## 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–2022 Brockmann Consult GmbH. All rights reserved.