Skip to main content

jbang-python - Java Script in your Python

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.

Usage

You can run the package in two ways:

1. Using the console script

After installation, you can use the jbang-python command:

jbang-python properties@jbangdev

2. Using Python's module runner

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

Command-line Arguments

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.

Behind the scenes

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.

Improvements ?

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.

Similar projects

  • jgo - allows execution of Maven artifacts by using Maven.

Release files for jbang 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jbang 0.8.0
File Size Uploaded
jbang-0.8.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jbang 0.8.0
File Interpreter ABI Platform
jbang-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / jbang-0.8.0.tar.gz

Download URL jbang-0.8.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c4f3e1f1fc5c84ccc6d080982afdb14dabb48740a24093bb7c6562a46afc2d35
BLAKE2b-256 checksum
How to use checksums
12a455bbab2a7b13c92ec0f56b8b07b55aed390e074a52c780245d41202f9f46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / jbang-0.8.0-py3-none-any.whl

Download URL jbang-0.8.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88311322573f18af48324a7be367adcb27eddba45586ac1a197f042e83c47ebf
BLAKE2b-256 checksum
How to use checksums
55df914b29c4da5ed0746c6f29a7f00d9e4644aa2c2ff5c28dc46833d3083093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page