# py4j/py4j

Py4J enables Python programs to dynamically access arbitrary Java objects

Repository: https://github.com/py4j/py4j
Canonical: https://ross.abutalabs.com/products/py4j
Homepage: https://www.py4j.org
Language: Java
License: NOASSERTION
License Family: other
Topics: python, java, distributed-systems, programming-languages
Last push: 2026-06-11T17:33:19+00:00

## Health v2 (maintenance only)
Score: 71/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 87, release rhythm 35, longevity 100
- inputs: {"age_days": 5783, "days_push": 83, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1288, forks 234 (observed 2026-08-28T04:04:15.107757+00:00)

## What it is
Py4J is a library that lets Python programs dynamically access Java objects in a JVM over sockets, calling methods as if the objects lived in Python, and lets Java call back into Python. It requires no code generation and works with any Python interpreter, including ones with C extensions.

## Use cases
- call Java libraries from Python
- use a Java framework from a Python script
- bridge Python and JVM code without Jython
- implement Java interfaces in Python
- access Java collections from Python
- reuse existing Java code in a Python application

## When to choose
- you need to call Java code from CPython while keeping native Python libraries like lxml or numpy
- you want dynamic, no-codegen access to arbitrary Java objects
- you need bidirectional Python-Java callbacks
- portability across JVMs matters more than raw interop speed

## When to avoid
- you need maximum performance - socket-based RPC has high overhead compared to JPype or Jython
- you need Python threads mapped to Java threads
- you want to run Python code inside the JVM
- your project is Spark-specific and can use its native Python APIs

## Facets
- artifact type: library
- maturity: maintenance
- function: rpc, sdk, developer-tools
- domain: programming-languages, microservices, developer-tools, cross-platform
- platform: python, jvm, cross-platform
- tags: python-java-bridge, interop, jvm, sockets, gateway

## Member repositories
- py4j/py4j (main) score 71

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:15.107757+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:55:49.458197+00:00, confidence not recorded.
  - readme: https://github.com/py4j/py4j (fetched 2026-08-28T04:04:15.107757+00:00, sha f510f699d385)
  - homepage: https://www.py4j.org (fetched 2026-08-29T12:11:53.697536+00:00, sha 651ee161b3b8)
  - site_page: https://www.py4j.org/about.html (fetched 2026-08-29T12:11:53.706699+00:00, sha 257632e5a4f0)
  - site_page: https://www.py4j.org/contents.html (fetched 2026-08-29T12:11:53.708419+00:00, sha e7d0c7e6dd36)
  - site_page: https://www.py4j.org/faq.html (fetched 2026-08-29T12:11:53.710486+00:00, sha a2fa7b7f51f6)
  - site_page: https://www.py4j.org/changelog.html (fetched 2026-08-29T12:11:53.712354+00:00, sha c988ad3f8219)
- Data as of 2026-08-30T08:39:29.467469+00:00.
