Skip to main content

The JPype java.* type definitions with automatic Java string -> Python string conversions enabled

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

java_stubs_converted_strings-0.1.0.tar.gz (247.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

java_stubs_converted_strings-0.1.0-py3-none-any.whl (280.2 kB view details)

Uploaded Python 3

File details

Details for the file java_stubs_converted_strings-0.1.0.tar.gz.

File metadata

  • Download URL: java_stubs_converted_strings-0.1.0.tar.gz
  • Upload date:
  • Size: 247.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for java_stubs_converted_strings-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39299d54eaf14013fb26085f239fe0a66c5cd0e97cf5dbeeea223925f24ba219
MD5 95bbbcfb40812addb7b1b7502b39d0bb
BLAKE2b-256 0ea80f775fdf231db7b4e33fc27bc3c846499e910277e604bafff4ee4ed50df3

See more details on using hashes here.

File details

Details for the file java_stubs_converted_strings-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: java_stubs_converted_strings-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 280.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for java_stubs_converted_strings-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da6310989b09d3097ba10969827d22ecbe94a0178c21d165fdeb8029d6615875
MD5 76a66233df007dfeef677de4b8e80fcf
BLAKE2b-256 b6d6cfe0031028170bcd036ccbd194b1e717dab4f1f7d5c3d48e497d34d50895

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page