Skip to main content

The JPype java.* type definitions (the default, no automated Java string -> Python string conversions)

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-0.1.0.tar.gz (249.6 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-0.1.0-py3-none-any.whl (282.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: java_stubs-0.1.0.tar.gz
  • Upload date:
  • Size: 249.6 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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ee445ca76db9817eb0e7e255b48c2181c0c8b9618b9261af04d305b47382898
MD5 460ae976a9f65f010a4714594fab8c5d
BLAKE2b-256 927459033d5de913d7cd082f5e4fbf021315b86974014799e05157f46581ec36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: java_stubs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 282.6 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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 090661c36ac346d9d6f555fd9e1c30ca413b90318631971922cf86c7bb962f6a
MD5 b2839f8be26229ce6c34cf4bd800da14
BLAKE2b-256 7066c21566a446351c4fda604a05367558864260ca2ca97acf42330145a97ae3

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