允许Python动态访问任意Java对象(基于CyTys/CFFI的PY4J)

jtypes.py4j的Python项目详细描述


当前仅作为占位符(因为基本包jtypes.jvm仍在开发中)

j类型.py4j

使python能够动态访问任意java对象。

概述

jtypes.py4j enables Python programs to dynamically access arbitrary Java objects via Java’s Native Invocation Interface (JNI).

PyPI record.

jtypes.py4j is a lightweight Python package, based on the ctypes or cffi library.
It is an almost fully compliant implementation of Barthelemy Dagenais’s Py4J package by reimplementing its functionality in a clean Python via JNI instead of Python and Java via custom API service.

关于PY4J:

original website

Py4J enables Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine. Methods are called as if the Java objects resided in the Python interpreter and Java collections can be accessed through standard Python collection methods. Py4J also enables Java programs to call back Python objects.

Here is a brief example of what you can do with Py4J.
The following Python program creates a java.util.Random instance from a JVM and calls some of its methods.
>>>frompy4j.java_gatewayimportJavaGateway>>>gateway=JavaGateway()# connect to the JVM>>>random=gateway.jvm.java.util.Random()# create a java.util.Random instance>>>number1=random.nextInt(10)# call the Random.nextInt method>>>number2=random.nextInt(10)>>>print(number1,number2)(2,7)

要求

  • Java运行时(JRE)或Java开发工具包(JDK)和numpy。

安装

先决条件:

要安装,请运行:

python -m pip install --upgrade jtypes.py4j

为了确保一切正常运行,您可以使用:

python -m jt.py4j.tests

开发

访问development page

从源安装:

克隆sources并运行:

python -m pip install ./jtypes.py4j

或开发模式:

python -m pip install --editable ./jtypes.py4j

先决条件:

  • 开发严格基于tox。要安装它,请运行:

    python -m pip install tox
    

许可证

Copyright (c) 2015-2018, Adam Karpierz

Licensed under the BSD license
Please refer to the accompanying LICENSE file.

作者

更改日志

0.10.8a1(2018-11-08)

  • 与PY4J主分支同步(V.0.10.8)。
  • 更新所需的setuptools版本。
  • 小的设置和测试改进。

0.10.7a2(2018-09-14)

  • 与PY4J主分支同步(V.0.10.7)。

0.10.7a1(2018-06-15)

  • 与PY4J主分支同步(V.0.10.7)。

0.10.6a4(2018-05-22)

  • 更新所需的setuptools版本。

0.10.6a3(2018-02-26)

  • 改进和简化安装和包装。

0.10.6a2(2018-01-29)

  • 开发转移到github。
  • 版本号同步。使用原装PY4J。

0.0.1a1(2017-01-10)

  • 第一次阿尔法释放。

0.0.1a0(2015-08-05)

  • 初始版本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android:在ListView上使用setOnItemClickListener   使用Netbeans 7.0连接到SQL Server的java正在挂起   java Spring3依赖项注入不适用于mule   java Flink SQL结果字段与LocalDateTime上请求的类型错误不匹配   java找不到文件的结尾   考虑到NamingStrategy,java有没有办法将字符串转换为JsonNode?   使用Netbeans/ant部署java(命令行)应用程序   java如何修复Spring引导多部分上载中的“所需请求部分不存在”   java在应用程序启动时通过引用获取映射未知目标实体属性异常   java形状旋转问题Java2d   Weblogic服务器上的java ExecuteAndWaitInterceptor问题   JavaSpringBoot:project将图像保存在错误的路径中,并且在使用IDEIntellji打开时不显示图像   类向java接口添加方法   Swing组件上的Java 7泛型   sql server如何从java获取用户名。sql。联系   java如何检查该行是否与正则表达式(regex)冲突?   java如何在spring引导安全中为计数失败登录设置验证登录为false   图像如何在Java中使PNG的白色透明?