skillfed

pemja

PemJa

pemja v0.6.1 227.2K downloads/30d#9,184 on PyPI
Permissive license https://www.apache.org/licenses/LICENSE-2.0 AGING released

What it is and what it does

PemJa is a cross-language FFI framework that bridges Python and Java, allowing bidirectional method invocation. From Java, you can instantiate a Python interpreter, execute Python code, call Python functions, and retrieve results as typed Java objects. From Python, you can locate and invoke Java classes and methods. The package ships as prebuilt wheels for Python 3.8–3.13 on macOS and Linux, with a single runtime dependency on find-libpython.

Typical use cases include embedding Python scripting in Java applications, automating Python workflows from Java, or building polyglot systems where performance-critical code runs in Java and data processing or prototyping happens in Python. Installation is straightforward via pip on supported platforms, though Windows builds require manual setup and the aging maintenance status suggests the project may not be actively developed.

Use it for:

  • Embed Python scripting logic into a Java application without spawning separate processes.
  • Call Java libraries from Python code to leverage existing Java ecosystems or performance-critical components.
  • Build data pipelines where Java handles I/O and Python handles numerical or ML transformations.
  • Prototype algorithms in Python and invoke them from a production Java service.
  • Implement Python callbacks that respond to events or requests originating in Java.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PemJa enables Python code to call Java methods and classes, and Java code to invoke Python functions, using FFI-based cross-language interoperability.

Yes, if you need bidirectional Python-Java interop and can tolerate aging maintenance. The package is stable (Production/Stable classifier), has no known vulnerabilities, and covers modern Python versions with prebuilt wheels. However, the 413-day release gap suggests limited ongoing support; evaluate whether the project's maturity and your platform requirements align before committing to a production dependency.

Install

pemja on PyPI

pip

pip install pemja

uv

uv add pemja

poetry

poetry add pemja

Installing pemja

Before you install

Medium install friction due to native wheels and a runtime dependency on find-libpython. Prebuilt wheels cover Python 3.8–3.13 on macOS (Intel and ARM) and Linux x86_64, but the package is aging—last release was 413 days ago.

License in practice

Apache 2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.

Quickstart

pip install pemja

# In Java:
PythonInterpreterConfig config = PythonInterpreterConfig
    .newBuilder()
    .setPythonExec("python3")
    .build();
PythonInterpreter interpreter = new PythonInterpreter(config);
interpreter.set("a", 12345);
interpreter.get("a", Integer.class);

Requires Java 8 or 11 with $JAVA_HOME set; on Windows, Microsoft Visual C++ 14.0 or greater is required. Python >= 3.8.

Verify before relying

  • Whether the 413-day gap since last release indicates active maintenance or dormancy.
  • Performance characteristics and overhead of the FFI bridge for typical workloads.
  • Compatibility with Python versions beyond 3.13 or Java versions beyond 11.

Package facts

License https://www.apache.org/licenses/LICENSE-2.0 (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — find-libpython
Maintenance aging — 413 days since the last release
First released
Downloads 227,162/month — #9,184 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pemja-0.6.1-cp310-cp310-macosx_10_9_x86_64.whl; pemja-0.6.1-cp310-cp310-macosx_11_0_arm64.whl; pemja-0.6.1-cp310-cp310-manylinux1_x86_64.whl; pemja-0.6.1-cp311-cp311-macosx_10_9_x86_64.whl; pemja-0.6.1-cp311-cp311-macosx_11_0_arm64.whl; pemja-0.6.1-cp311-cp311-manylinux1_x86_64.whl; pemja-0.6.1-cp312-cp312-macosx_10_13_x86_64.whl; pemja-0.6.1-cp312-cp312-macosx_11_0_arm64.whl; pemja-0.6.1-cp312-cp312-manylinux1_x86_64.whl; pemja-0.6.1-cp313-cp313-macosx_10_13_x86_64.whl; pemja-0.6.1-cp313-cp313-macosx_11_0_arm64.whl; pemja-0.6.1-cp313-cp313-manylinux1_x86_64.whl; pemja-0.6.1-cp313-cp313t-macosx_10_13_x86_64.whl; pemja-0.6.1-cp313-cp313t-macosx_11_0_arm64.whl; pemja-0.6.1-cp313-cp313t-manylinux1_x86_64.whl; pemja-0.6.1-cp38-cp38-macosx_10_9_x86_64.whl; pemja-0.6.1-cp38-cp38-macosx_11_0_arm64.whl; pemja-0.6.1-cp38-cp38-manylinux1_x86_64.whl; pemja-0.6.1-cp39-cp39-macosx_10_9_x86_64.whl; pemja-0.6.1-cp39-cp39-macosx_11_0_arm64.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPython

Tags

python java interopcall java from pythonpython java bridgecross language ffijava python integrationinvoke java methods pythonembedded python interpreter
polyglotffi-bridgejava-interop

More Application Frameworks packages