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

去到頂部