Jep

在 Java 中嵌入 Python。「Embed Python in Java」

Github星跟踪图

Jep -- 在 Java 中嵌入 Python

Jep 通过 JNI 将 CPython 嵌入到 Java 中。

在 JVM 中嵌入 CPython 的一些好处:

  • 使用本地 Python 解释器可能比其他方法快得多。
  • Python 是成熟的,得到很好的支持,并且有很好的文档。
  • 可以获得高质量的 Python 模块,包括本地 CPython 扩展和基于 Python 的模块。
  • 编译器和各种 Python 工具与该语言一样成熟。
  • Python 是一种解释型语言,能够对已建立的 Java 代码进行脚本处理,而不需要重新编译。
  • Java 和 Python 都是跨平台的,可以部署到不同的操作系统上。

安装

只需运行 pip install jep 或下载源代码并运行 python setup.py build install。建立和安装需要事先安装 JDK、Python 和可选的 numpy。

依赖性

  • Python 2.7、3.3、3.4、3.5、3.6、3.7、3.8 或 3.9
  • Java >= 1.7
  • NumPy >= 1.7 (可选)

值得注意的特性

  • 交互式 Jep 控制台很像 Python 的交互式控制台
  • 支持多个同时进行的、主要是沙盒式的子解释器或共享解释器
  • 对 Java 原始数组的 Numpy 支持

帮助

我们欢迎评论、贡献、错误报告、wiki 文档等。

Jep 团队

概览

名称与所有者ninia/jep
主编程语言C
编程语言Python (语言数: 5)
平台Linux, Mac, Windows
许可证Other
发布数32
最新版本名称v4.2.0 (发布于 )
第一版名称v3.2.0 (发布于 )
创建于2011-02-18 01:30:05
推送于2023-12-16 16:10:19
最后一次提交2023-12-16 10:02:42
星数1.3k
关注者数57
派生数145
提交数1.4k
已启用问题?
问题数451
打开的问题数92
拉请求数66
打开的拉请求数1
关闭的拉请求数13
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

image

image

image

image

image

Jep - Java Embedded Python

Jep embeds CPython in Java through JNI.

Some benefits of embedding CPython in a JVM:

  • Using the native Python interpreter may be much faster than
    alternatives.
  • Python is mature, well supported, and well documented.
  • Access to high quality Python modules, both native CPython
    extensions and Python-based.
  • Compilers and assorted Python tools are as mature as the language.
  • Python is an interpreted language, enabling scripting of established
    Java code without requiring recompilation.
  • Both Java and Python are cross platform, enabling deployment to
    different operating systems.

Installation

Simply run pip install jep or download the source and run
python setup.py build install. Building and installing require the
JDK, Python, and optionally numpy to be installed beforehand.

Dependencies

  • Python 2.7, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, or 3.9
  • Java >= 1.7
  • NumPy >= 1.7 (optional)

Notable features

  • Interactive Jep console much like Python's interactive console
  • Supports multiple, simultaneous, mostly sandboxed sub-interpreters
    or shared interpreters
  • Numpy support for Java primitive arrays

Help

We welcome comments, contributions, bug reports, wiki documentation,
etc.

Jep Team

去到顶部