Jep

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

Github stars Tracking Chart

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 团队

Overview

Name With Ownerninia/jep
Primary LanguageC
Program languagePython (Language Count: 5)
PlatformLinux, Mac, Windows
License:Other
Release Count32
Last Release Namev4.2.0 (Posted on )
First Release Namev3.2.0 (Posted on )
Created At2011-02-18 01:30:05
Pushed At2023-12-16 16:10:19
Last Commit At2023-12-16 10:02:42
Stargazers Count1.3k
Watchers Count57
Fork Count145
Commits Count1.4k
Has Issues Enabled
Issues Count449
Issue Open Count90
Pull Requests Count66
Pull Requests Open Count1
Pull Requests Close Count13
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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

To the top