PEP484 python stub generator for Java classes accessed through Chaquopy on Android
Project description
chaquopy-stubgen
This tool is a python type stub generator from java classes. It is optimized for the usage with Android via chaquopy v16.1 and briefcase.
This is based on stubgenj. Although the tool generates stubs optimized for chaquopy, it still uses jpype internally to parse the Java files.
The generated stubs can be used with Python 3.8 or higher.
CLI Usage
Example call python -m chaquopy_stubgen java android --classpath android.jar
$ python -m chaquopy_stubgen --help
usage: __main__.py [-h] [--jvmpath JVMPATH] [--classpath CLASSPATH] [--output-dir OUTPUT_DIR] [--no-javadoc] prefixes [prefixes ...]
Generate Python Type Stubs for Java classes that are optimized for chaquopy.
positional arguments:
prefixes package prefixes to generate stubs for (e.g. org.myproject)
options:
-h, --help show this help message and exit
--jvmpath JVMPATH path to the JVM ("libjvm.so", "jvm.dll", ...) (default: use system default JVM)
--classpath CLASSPATH
java class path to use, separated by ":". glob-like expressions (e.g. dir/*.jar) are supported (default: .)
--output-dir OUTPUT_DIR
path to write stubs to (default: .)
--no-javadoc do not generate docstrings from JavaDoc where available
Development
- Create venv:
uv sync - Test:
uv run pytest
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chaquopy_stubgen-0.1.0.tar.gz.
File metadata
- Download URL: chaquopy_stubgen-0.1.0.tar.gz
- Upload date:
- Size: 24.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
431ca15c684e92a848c44fca8ed2cfb5c484498cce179295043e0ded3887ea4c
|
|
| MD5 |
f157c9891552b8f188b8366fb66e896d
|
|
| BLAKE2b-256 |
1cb1e4d04b81b37781f00713b2a9cd35117887d5e86480c5b805737be8d8e80f
|
Provenance
The following attestation bundles were made for chaquopy_stubgen-0.1.0.tar.gz:
Publisher:
python-publish.yml on timrid/chaquopy-stubgen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chaquopy_stubgen-0.1.0.tar.gz -
Subject digest:
431ca15c684e92a848c44fca8ed2cfb5c484498cce179295043e0ded3887ea4c - Sigstore transparency entry: 368726962
- Sigstore integration time:
-
Permalink:
timrid/chaquopy-stubgen@d3f1dfc0c38b04f6f450bb5b7d4ace85967ac2cc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/timrid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d3f1dfc0c38b04f6f450bb5b7d4ace85967ac2cc -
Trigger Event:
release
-
Statement type:
File details
Details for the file chaquopy_stubgen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chaquopy_stubgen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e3d6030db0671c70e0232d5d6aeea25663fe9525833089adddd5dff043867e2
|
|
| MD5 |
4046242eea41883ac8e8bc82adef2385
|
|
| BLAKE2b-256 |
519cc9482ded805bf61fbd8e629b6eb212fd0bc1e2a083751849cd1b0c68684b
|
Provenance
The following attestation bundles were made for chaquopy_stubgen-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on timrid/chaquopy-stubgen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chaquopy_stubgen-0.1.0-py3-none-any.whl -
Subject digest:
9e3d6030db0671c70e0232d5d6aeea25663fe9525833089adddd5dff043867e2 - Sigstore transparency entry: 368726987
- Sigstore integration time:
-
Permalink:
timrid/chaquopy-stubgen@d3f1dfc0c38b04f6f450bb5b7d4ace85967ac2cc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/timrid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d3f1dfc0c38b04f6f450bb5b7d4ace85967ac2cc -
Trigger Event:
release
-
Statement type: