graalpython  by oracle

Python runtime for Java, built on GraalVM

created 7 years ago
1,437 stars

Top 29.0% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

GraalPy is a high-performance, embeddable Python 3.11 runtime built on GraalVM, targeting Java developers and Python users seeking improved performance and seamless Java integration. It offers faster execution for pure Python code, near CPython performance for C extensions, and the ability to create standalone binaries, making it suitable for production use with pure Python and experimental support for native extensions.

How It Works

GraalPy leverages GraalVM's advanced Just-In-Time (JIT) compilation and Ahead-Of-Time (AOT) compilation via Native Image. This allows it to achieve significant performance gains over CPython for pure Python code through aggressive optimizations. Its Java-based emulation of Python OS APIs enables low-overhead integration with Java applications and JVM tooling, while also providing a controlled environment for managing system access.

Quick Start & Requirements

  • Installation: Recommended via pyenv (pyenv install graalpy-24.2.0, pyenv shell graalpy-24.2.0). Alternatively, download from GitHub releases and update PATH. Windows users can use pyenv-win.
  • Prerequisites: GraalVM (implicitly via GraalPy), build tools for compiling native extensions.
  • Resources: Installation via pyenv is quick; compiling packages with native extensions can be time-consuming.
  • Docs: Embedding documentation, Python Standalone Applications, GraalPy Quick Reference Sheet.

Highlighted Details

  • ~4x faster than CPython on the official Python Performance Benchmark Suite.
  • Experimental support for popular native extension modules like NumPy, PyTorch, and TensorFlow.
  • Can be embedded in Java applications and used with JVM tools (Maven, JFR, Native Image).
  • Supports creating standalone Python binaries with all dependencies included.

Maintenance & Community

  • Active development by Oracle.
  • Community engagement via #graalpy channel on GraalVM Slack and Twitter.
  • Contribution guide and Oracle Contributor Agreement required for contributions.
  • GraalVM Slack

Licensing & Compatibility

  • License: Universal Permissive License v 1.0 (UPL 1.0).
  • Compatible with most standard Python features and the Python ecosystem. Commercial use is permitted.

Limitations & Caveats

  • Native extension module support is experimental; compilation may be required for packages without pre-built binaries.
  • Windows support is experimental.
  • There can be a delay between GraalPy releases and their availability on pyenv.
Health Check
Last commit

23 hours ago

Responsiveness

Inactive

Pull Requests (30d)
6
Issues (30d)
10
Star History
82 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Didier Lopes Didier Lopes(Founder of OpenBB), and
9 more.

pyo3 by PyO3

0.3%
14k
Rust bindings for Python, enabling native extension modules
created 8 years ago
updated 1 day ago
Starred by Max Howell Max Howell(Author of Homebrew) and Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers).

kohya_ss by bmaltais

0.2%
11k
GUI for Stable Diffusion training scripts
created 2 years ago
updated 1 week ago
Feedback? Help us improve.