Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

jpy-consortium/jpy

Repository files navigation

Build Status

jpy - a Python-Java Bridge

jpy is abi-directional Python-Java bridge which you can use to embed Javacode in Python programs or the other way round. It has been designedparticularly with regard to maximum data transfer speed between the twolanguages. It comes with a number of outstanding features:

  • Fully translates Java class hierarchies to Python
  • Transparently handles Java method overloading
  • Support of Java multi-threading
  • Fast and memory-efficient support of primitive Java array parameters viaPython buffers(e.g.Numpy arrays)
  • Support of Java methods that modify primitive Java array parameters (mutableparameters)
  • Java arrays translate into Python sequence objects
  • Java API for accessing Python objects (jpy.jar)

jpy has been tested with Python 3.6–3.13 and OpenJDK 8+ on Linux, Windows, and macOS.

The initial development of jpy was driven by the need to write Pythonextensions to an established scientific imaging application programmed inJava, namely theSNAP toolbox, the SeNtinelApplication Platform project, funded by theEuropean SpaceAgency (ESA). (jpy is bundled with the SNAPdistribution.) Current development and maintenance is funded byDeephaven.

Writing such Python plug-ins for a Java application usually requires abi-directional communication between Python and Java since the Pythonextension code must be able to call back into the Java APIs.

For more information please have a look into jpy's

How to build wheels for Linux and Mac

Install a JDK 8, preferably the Oracle distribution. SetJDK_HOME orJPY_JDK_HOME to point to your JDK installation and run the build script:

$ export JDK_HOME=<your-jdk-dir>$ export JAVA_HOME=$JDK_HOME$ pip install setuptools wheel$ python setup.py build maven bdist_wheel

On success, the wheel is found in thedist directory.

To deploy thejpy.jar (if you don't know why you need this step, this is notfor you)::

$ mvn clean deploy -DskipTests=true

How to build a wheel for Windows

SetJDK_HOME orJPY_JDK_HOME to point to your JDK installation. You'llneed Windows SDK 7.1 or Visual Studio C++ to build the sources. With WindowsSDK 7.1::

> SET VS90COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\> SET DISTUTILS_USE_SDK=1> C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv /x64 /release> SET JDK_HOME=<your-jdk-dir>> pip install setuptools wheel> python setup.py build maven bdist_wheel

With Visual Studio 14 and higher it is much easier::

> SET VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\> SET JDK_HOME=<your-jdk-dir>> pip install setuptools wheel> python setup.py build maven bdist_wheel

On success, the wheel can be found in thedist directory.

How to install from sources

TBD

Releasing jpy

The target reader of this section is a jpy developer wishing to release a newjpy version. Note: You need to have Sphinx installed to update thedocumentation.

  1. Make sure all Javaand Python units tests run green
  2. Remove the-SNAPSHOT qualifier from versions names in both the Mavenpom.xml andsetup.py files, and update the version numbers and copyrightyears injpyutil.py anddoc/conf.py.
  3. Generate Java API doc by runningmvn javadoc:javadoc which will updatedirectorydoc/_static
  4. Update documentation,cd doc and runmake html
  5. http://peterdowns.com/posts/first-time-with-pypi.html

Running Tests

Run:python setup.py build test

Code Of Conduct

This project has adopted theContributor Covenant Code of Conduct.For more information see theCode of Conduct or contactopencode@deephaven.iowith any additional questions or comments.

Contributing

For instructions on contributing, seeCONTRIBUTING.md.

Notes

Some of the details on this README are out of date. Efforts to improve them will be made in the future.


[8]ページ先頭

©2009-2025 Movatter.jp