You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
</a> [![Join Slack][badge-slack]][slack][![GraalVM on Twitter][badge-twitter]][twitter][](#license)
6
+
3
7
GraalPy is a high-performance implementation of the [Python](https://www.python.org/) language for the JVM built on [GraalVM](https://www.graalvm.org/) technology.
4
8
GraalPy has first-class support for embedding in Java and can turn Python applications into fast, standalone binaries.
5
9
6
-
<sup>
7
-
[Java AWT app with Python graph library](https://github.com/timfel/graalpy-jbang) using [JBang](https://www.jbang.dev/) | [Standalone binary](https://github.com/timfel/racing-all-afternoon) of a Python game by [Joey Navarro](https://github.com/josephnavarro/racing-all-afternoon) with all dependencies included.
8
-
</sup>
9
-
10
10
## Why GraalPy?
11
11
12
12
**Low-overhead integration with Java and other languages.**
13
13
14
-
*[Interoperate](docs/user/Interoperability.md)with Java, JavaScript, Ruby, and other languages on GraalVM JDK, Oracle JDK, or OpenJDK
14
+
*Use [Python in Java](docs/user/Interoperability.md)applications on GraalVM JDK, Oracle JDK, or OpenJDK
15
15
* Use JVM tools like [Maven](docs/user/PythonStandaloneBinaries.md#embedding-graalpy-in-a-java-application), JFR, or [GraalVM Native Image](docs/user/PythonNativeimages.md)
16
16
* Manage Python libraries' system access thanks to GraalPy's [Java-based emulation of Python OS APIs](docs/user/OsInterface.md#java-backend)
17
17
18
18
**Compatible with the Python ecosystem**
19
19
20
-
* Use almost any standard Python feature, the CPython tests run on every commit and pass ~85%
21
20
* Install [packages](https://pypi.org/) like *NumPy*, *PyTorch*, or *Tensorflow*; run [Hugging Face](https://huggingface.co/) models like *Stable Diffusion* or *GPT*
22
21
* See if the packages you need work with our [Python Compatibility Checker](https://www.graalvm.org/python/compatibility/)
22
+
* Use almost any standard Python feature, the CPython tests run on every commit and pass ~85%
23
23
<sup>
24
24
We run the tests of the [top PyPI packages](https://hugovk.github.io/top-pypi-packages/) on GraalPy every day.
25
25
For more than 96% of the top PyPI packages, there is at least one recent version that installs successfully and we are currently passing over 50% of all tests those top packages.
@@ -40,7 +40,7 @@ Geomean speedup was calculated against CPython on the intersection of benchmarks
40
40
## Getting Started
41
41
42
42
<details>
43
-
<summary><strong>Embedding GraalPy in Java</strong></summary>
43
+
<summary><strong><aname="start-embedding-graalpy-in-java"></a>Embedding GraalPy in Java</strong></summary>
44
44
45
45
GraalPy is [available on Maven Central](https://central.sonatype.com/artifact/org.graalvm.polyglot/python) for inclusion in Java projects.
46
46
Refer to our [embedding documentation](https://www.graalvm.org/latest/reference-manual/embed-languages/) for more details.
@@ -69,7 +69,7 @@ Refer to our [embedding documentation](https://www.graalvm.org/latest/reference-
69
69
</details>
70
70
71
71
<details>
72
-
<summary><strong>Replacing CPython with GraalPy</strong></summary>
72
+
<summary><strong><aname="start-replacing-cpython-with-graalpy"></a>Replacing CPython with GraalPy</strong></summary>
73
73
74
74
GraalPy should in many cases work as a drop-in replacement for CPython.
75
75
You can use `pip` to install packages as usual.
@@ -126,20 +126,20 @@ Thanks to our integration with GraalVM Native Image, we can deploy Python applic
126
126
127
127
</details>
128
128
<details>
129
-
<summary><strong>Using GraalPy in Github Actions</strong></summary>
129
+
<summary><strong><a name="start-using-graalpy-in-github-actions"></a>Using GraalPy in Github Actions</strong></summary>
130
130
131
131
The _setup-python_ action supports GraalPy:
132
132
133
-
```
133
+
```yaml
134
134
- name: Setup GraalPy
135
-
uses: actions/setup-python@main
135
+
uses: actions/setup-python@v5
136
136
with:
137
137
python-version: graalpy # or graalpy23.1 to pin a version
138
138
```
139
139
140
140
</details>
141
141
<details>
142
-
<summary><strong>Migrating Jython Scripts to GraalPy</strong></summary>
142
+
<summary><strong><a name="start-migrating-jython-scripts-to-graalpy"></a>Migrating Jython Scripts to GraalPy</strong></summary>
143
143
144
144
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.
145
145
To migrate your code from Python 2 to Python 3, follow [the official guide from the Python community](https://docs.python.org/3/howto/pyporting.html).
@@ -174,20 +174,25 @@ To run Jython scripts, you need to use a GraalPy distribution running on the JVM
174
174
175
175
</details>
176
176
177
+
### Examples
178
+
<sup>
179
+
[Java AWT app with Python graph library](https://github.com/timfel/graalpy-jbang) using [JBang](https://www.jbang.dev/) | [Standalone binary](https://github.com/timfel/racing-all-afternoon) of a Python game by [Joey Navarro](https://github.com/josephnavarro/racing-all-afternoon) with all dependencies included.
180
+
</sup>
181
+
177
182
## Documentation
178
183
179
184
Our [Quick Reference Sheet](https://www.graalvm.org/uploads/quick-references/GraalPy_v1/quick-reference-graalpy-v1(eu_a4).pdf) should help you get started.
180
185
More GraalPy-specific user documentation is available in [docs/user](docs/user).
181
186
General documentation about [polyglot programming](https://www.graalvm.org/latest/reference-manual/polyglot-programming/) and [language embedding](https://www.graalvm.org/latest/reference-manual/embed-languages/) is available on the GraalVM website.
182
187
183
-
## Contact
188
+
## Community
184
189
185
-
The best way to get in touch with us is to join the `#graalpy` channel on [GraalVM Slack](https://www.graalvm.org/slack-invitation/).
190
+
The best way to get in touch with us is to join the `#graalpy` channel on [GraalVM Slack][slack] or write to us on [Twitter][twitter]
186
191
187
192
## Contributing
188
193
189
-
If you're thinking about contributing something to this repository, you will need to sign the [Oracle Contributor Agreement](http://www.graalvm.org/community/contributors/) for us to able to merge your work.
190
-
Please also take note of our [code of conduct](http://www.graalvm.org/community/conduct/) for contributors.
194
+
If you're thinking about contributing something to this repository, you will need to sign the [Oracle Contributor Agreement](https://www.graalvm.org/community/contributors/) for us to able to merge your work.
195
+
Please also take note of our [code of conduct](https://www.graalvm.org/community/conduct/) for contributors.
191
196
192
197
This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md).
193
198
@@ -199,3 +204,8 @@ Please consult the [security guide](./SECURITY.md) for our responsible security
199
204
200
205
This GraalVM implementation of Python is Copyright (c) 2017, 2024 Oracle and/or its affiliates and is made available to you under the terms the Universal Permissive License v 1.0 as shown at [https://oss.oracle.com/licenses/upl/](https://oss.oracle.com/licenses/upl/).
201
206
This implementation is in part derived from and contains additional code from 3rd parties, the copyrights and licensing of which is detailed in the [LICENSE](./LICENSE.txt) and [THIRD_PARTY_LICENSE](THIRD_PARTY_LICENSE.txt) files.
0 commit comments