Skip to main content

The JPype java.* type definitions. They cover imports like from java.util import ArrayList.

There are two mutually exclusive variants distributed under different names:

  1. java-stubs (no automated Java string to Python string conversions)

  2. java-stubs-converted-strings (with the conversions)

Some details from JPype string conversions documentation:

The convertStrings argument controls whether Java strings are automatically converted to Python strings. By default, this behavior is disabled (convertStrings=False) to preserve Java string methods and avoid unnecessary conversions.

If enabled (convertStrings=True), Java strings are returned as Python strings, but this can impact performance and chaining of Java string methods. This option is consisted a legacy option as it will result in unncessary calls to str() every time a String is passed from Java.

Best practice: Set convertStrings=False unless your application explicitly requires automatic conversion.

Which version you need depends on the convertStrings value used when starting the JVM.

Both of these distributions provide the java-stubs package providing type definitions for the whole java.* namespace.

The stubs are produced with CERN’s stubgenj.

There’s a related JPype discussion.

Known limitations

  • The types are tied to a specific Java version (currently OpenJDK 25).

  • The JPype version used when generating the types may affect them, currently only one version is used.

  • A few Java -> Python stubgenj translation problems have been reported, some are very difficult to resolve in a way that will satisfy all users (more: https://gitlab.cern.ch/scripting-tools/stubgenj/-/issues).

Internal documentation

Run ./generate to regenerate the stubs.

Release files for java-stubs-converted-strings 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for java-stubs-converted-strings 0.1.0
File Size Uploaded
java_stubs_converted_strings-0.1.0.tar.gz 247.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for java-stubs-converted-strings 0.1.0
File Interpreter ABI Platform
java_stubs_converted_strings-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 527.7 kB

Release files / java_stubs_converted_strings-0.1.0.tar.gz

Download URL java_stubs_converted_strings-0.1.0.tar.gz
Size 247.5 kB
Tags Source
SHA-256 checksum
How to use checksums
39299d54eaf14013fb26085f239fe0a66c5cd0e97cf5dbeeea223925f24ba219
BLAKE2b-256 checksum
How to use checksums
0ea80f775fdf231db7b4e33fc27bc3c846499e910277e604bafff4ee4ed50df3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / java_stubs_converted_strings-0.1.0-py3-none-any.whl

Download URL java_stubs_converted_strings-0.1.0-py3-none-any.whl
Size 280.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da6310989b09d3097ba10969827d22ecbe94a0178c21d165fdeb8029d6615875
BLAKE2b-256 checksum
How to use checksums
b6d6cfe0031028170bcd036ccbd194b1e717dab4f1f7d5c3d48e497d34d50895
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page