Install and use JBang from Python-based projects.
Lets you use your own local scripts, JBang AppStore alias or any network reachable jar or Maven artifact.
You can run the package in two ways:
After installation, you can use the jbang-python
command:
jbang-python properties@jbangdev
You can also run the package directly using Python's module runner:
python -m jbang properties@jbangdev
Or with uvx
:
uvx run -m jbang properties@jbangdev
You can easily pass command-line arguments around:
import sys
args = ' '.join(sys.argv[1:])
jbang.exec('com.myco.mylib:RELEASE ' + args)
So now if you run python test.py arg1 arg2
, arg1 arg2
will be appended to the command executed.
When you run pip install
- JBang and other dependencies will be installed. This uses the app setup
command.
Opening a new terminal or shell may be required to be able to use the jbang
command from the system PATH
.
This was made as a quick hack to see if it was possible to use JBang from Python based on jbang-npm. If you have any ideas on how to improve this, please open an issue or PR and lets see where this brings us.
- jgo - allows execution of Maven artifacts by using Maven.