Skip to main content

Python for JBang - Java Script in your Python

Project description

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.

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

jbang-0.8.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jbang-0.8.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file jbang-0.8.0.tar.gz.

File metadata

  • Download URL: jbang-0.8.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for jbang-0.8.0.tar.gz
Algorithm Hash digest
SHA256 c4f3e1f1fc5c84ccc6d080982afdb14dabb48740a24093bb7c6562a46afc2d35
MD5 682c58d6897ab45259dbe2d4e3d5010c
BLAKE2b-256 12a455bbab2a7b13c92ec0f56b8b07b55aed390e074a52c780245d41202f9f46

See more details on using hashes here.

File details

Details for the file jbang-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: jbang-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for jbang-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88311322573f18af48324a7be367adcb27eddba45586ac1a197f042e83c47ebf
MD5 5f53bc4ea51679f420f905ff392233b0
BLAKE2b-256 55df914b29c4da5ed0746c6f29a7f00d9e4644aa2c2ff5c28dc46833d3083093

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