back to home

oracle / graalpython

GraalPy – A high-performance embeddable Python 3 runtime for Java

1,572 stars
147 forks
64 issues
PythonJavaC

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing oracle/graalpython in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/oracle/graalpython)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

GraalPy, the GraalVM Implementation of Python [![Join Slack][badge-slack]][slack] [![GraalVM on Twitter][badge-twitter]][twitter] GraalPy is a high-performance implementation of the Python language for the JVM built on GraalVM. GraalPy is a Python 3.12 compliant runtime. It has first-class support for embedding in Java and can turn Python applications into fast, standalone binaries. GraalPy is ready for production running pure Python code and has experimental support for many popular native extension modules. Why GraalPy? **Low-overhead integration with Java and other languages** • Use Python in Java applications on GraalVM JDK, Oracle JDK, or OpenJDK • Use JVM tools like Maven, JFR, or GraalVM Native Image • Manage Python libraries' system access thanks to GraalPy's Java-based emulation of Python OS APIs **Compatible with the Python ecosystem** • Use almost any standard Python feature, the CPython tests run on every commit and pass ~85% • See if the packages you need work according to our Python Compatibility Checker • Support for native extension modules is considered experimental, but you can already install packages like *NumPy*, *PyTorch*, or *Tensorflow*; run Hugging Face models like *Stable Diffusion* or *GPT* We run the tests of the most depended on PyPI packages every day. For 97% of those packages a recent version can be installed on GraalPy and GraalPy passes over 60% of all tests of all packages combined. We assume that CPython not passing 100% of all tests is due to problems in our infrastructure that may also affect GraalPy. Packages where CPython fails all tests are marked as "not tested" for both CPython and GraalPy. **Runs Python code faster** • Pure Python code is often faster than on CPython after JIT compilation • C extension performance is near CPython, but varies depending on the specific interactions of native and Python code • GraalPy is ~4x faster than CPython on the official Python Performance Benchmark Suite Benchmarks run via on each of CPython and GraalPy. Harness and benchmarks were adapted by hand for Jython due to missing Python 3 support. Each interpreter was installed via pyenv . Geomean speedup was calculated against CPython on the intersection of benchmarks that run on all interpreters. Getting Started Embedding GraalPy in Java GraalPy is available on Maven Central for inclusion in Java projects. Refer to our embedding documentation for more details. • Maven • Gradle Replacing CPython with GraalPy GraalPy should in many cases work as a drop-in replacement for CPython. You can use to install packages as usual. Packages with C code usually do not provide binaries for GraalPy, so they will be automatically compiled during installation. This means that build tools have to be available and installation will take longer. We provide Github actions to help you build binary packages with the correct dependencies. Thanks to our integration with GraalVM Native Image, we can deploy Python applications as standalone binary, all dependencies included. • Linux The easiest way to install GraalPy on Linux is to use Pyenv (the Python version manager). To install version 25.0.2 using Pyenv, run the following commands: > NOTE: There will be a delay between GraalPy release and its availability on Pyenv. Make sure to update Pyenv. Alternatively, you can download a compressed GraalPy installation file from GitHub releases. • Find the download that matches the pattern _graalpy-XX.Y.Z-linux-amd64.tar.gz_ or _graalpy-XX.Y.Z-linux-aarch64.tar.gz_ (depending on your platform) and download. • Uncompress the file and update your environment variable to include the _graalpy-XX.Y.Z-linux-amd64/bin_ (or _graalpy-XX.Y.Z-linux-aarch64/bin_) directory. • macOS The easiest way to install GraalPy on macOS is to use Pyenv (the Python version manager). To install version 25.0.2 using Pyenv, run the following commands: > NOTE: There will be a delay between GraalPy release and its availability on Pyenv. Make sure to update Pyenv. Alternatively, you can download a compressed GraalPy installation file from GitHub releases. • Find the download that matches the pattern _graalpy-XX.Y.Z-macos-aarch64.tar.gz_ and download. • Remove the quarantine attribute. For example: • Uncompress the file and update your environment variable to include to the _graalpy-XX.Y.Z-macos-aarch64/bin_ directory. • Windows The Windows support of GraalPy is still experimental, so not all features and packages may be available. The easiest way to install GraalPy on Windows is to use Pyenv-win (the Python version manager for Windows). To install version 25.0.2 using Pyenv-win, run the following commands: > NOTE: There will be a delay between GraalPy release and its availability on Pyenv. Make sure to update Pyenv. Alternatively, you can download a compressed GraalPy installation file from GitHub releases. • Find the download that matches the pattern _graalpy-XX.Y.Z-windows-amd64.tar.gz_ and download. • Uncompress the file and update your variable to include to the _graalpy-XX.Y.Z-windows-amd64/bin_ directory. Using GraalPy in Github Actions The _setup-python_ action supports GraalPy: Migrating Jython Scripts to GraalPy Most existing Jython code that uses Java integration will be based on a stable Jython release—however, these are only available in Python 2.x versions. To migrate your code from Python 2 to Python 3, follow the official guide from the Python community. GraalPy provides a special mode to facilitate migration. To run Jython scripts, you need to use a GraalPy distribution running on the JVM so you can access Java classes from Python scripts. • Linux • Find and download a compressed GraalPy installation file from GitHub releases that matches the pattern _graalpy-jvm-XX.Y.Z-linux-amd64.tar.gz_ or _graalpy-jvm-XX.Y.Z-linux-aarch64.tar.gz_ (depending on your platform) and download. • Uncompress the file and update your environment variable to include the _graalpy-jvm…