jentry
A simple tools to get the entries of a java projects, based on javalang library.
Installation
You can simply install it with pip command line from the official PyPI site.
pip install jentry
For more information about installation, you can refer to the installation guide.
Quick Start
Use with CLI
You can directly use jentry CLI to get the entry of a java project. Such as the command below
jentry demo
The output should be like as shown follow (in this project, we have 2 different entries)
Main
homework.Main
Only Use One Entry
You can get exactly one entry with -F command
jentry -F demo
The output should be
Main
This command can be used when you are trying to run a compiled java project, like this
java -cp target:${CLASSPATH} $(jentry -F demo)
The entry it found will be applied into the java command line.
Pretty Print Entry
Actually, these entries can be printed with prettier ways, such as json and table.
jentry -f json demo
The json-formatted output.
[
{
"entrance": "Main",
"package": null,
"class": "Main",
"file": "demo/2018_spring_16061104_10/src/Main.java"
},
{
"entrance": "homework.Main",
"package": "homework",
"class": "Main",
"file": "demo/oo_course_2019_17373331_homework_2/src/homework/Main.java"
}
]
And if the -f option is assigned to table
jentry -f table demo
A table with all the entries will be placed together.
+---------------+----------+-------+----------------------------------------------------------------+
| Entry | Package | Class | Filename |
+---------------+----------+-------+----------------------------------------------------------------+
| Main | <none> | Main | demo/2018_spring_16061104_10/src/Main.java |
| homework.Main | homework | Main | demo/oo_course_2019_17373331_homework_2/src/homework/Main.java |
+---------------+----------+-------+----------------------------------------------------------------+
Others
Other features can be found in the help information, which can be displayed with -h option.
jentry -h
Usage: jentry [OPTIONS] [SOURCES]...
Jentry - find the entry of your java project.
Options:
-v, --version Show package's version information.
-f, --format [table|json|entry]
The format to display the entries [default:
entry]
-s, --sorted_by [file|package|class|entry]
The order to sorted by. [default: file]
-r, --reverse Reverse the sorted result, only applied when
-s is used. [default: False]
-F, --first_only Only show the first entry. [default: False]
-h, --help Show this message and exit.
Use with Python
jentry can be imported into python
from jentry.entry.script import load_entries_from_project
if __name__ == '__main__':
for entry in load_entries_from_project('demo'):
print(repr(entry))
The output should be
<JavaEntry class: Main, filename: 'demo/2018_spring_16061104_10/src/Main.java'>
<JavaEntry class: homework.Main, filename: 'demo/oo_course_2019_17373331_homework_2/src/homework/Main.java'>
License
jentry released under the Apache 2.0 license.
Metadata
Release files for jentry 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jentry-1.0.1.tar.gz | 13.9 kB | Without provenance | Details for jentry-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jentry-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for jentry-1.0.1-py3-none-any.whl |
Total release size: 28.3 kB
Release files / jentry-1.0.1.tar.gz
| Download URL | jentry-1.0.1.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9046eeb2ec7b0acb240f356b88a21f1857fb8795ce45f739499d6b742a9c6cf5
|
|
BLAKE2b-256 checksum How to use checksums |
c8fd882a74178090af29b848815128afb27fc2d0acb77d15149c041d66c8e6d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11
|
Release files / jentry-1.0.1-py3-none-any.whl
| Download URL | jentry-1.0.1-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc44ca69b8b50e48be452c5c45976c084369b434428cbd6984d4b20d68078690
|
|
BLAKE2b-256 checksum How to use checksums |
53366f0eaa861d413352042f64ef8f13da946f7d289b649afa636483b4705c10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11
|
Security for jentry 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.