Skip to main content

Machai Ghostwriter Python Wrapper

mgw is a Python wrapper for the Machai Ghostwriter command-line processor. It exposes a Python API, the mgw console command, and the python -m mgw entry point. The package includes the Java runtime and starts the JVM lazily through JPype.

Project site: https://machai.machanism.org/ghostwriter-py/

Requirements

  • Python 3.9 or newer.
  • jpype1>=1.4.0 and jgo>=1.0.0 (installed automatically with mgw).
  • A Java installation supported by JPype, with JAVA_HOME set to its JDK or JVM installation.

Installation

Install the release from PyPI:

python -m pip install mgw

For a local checkout, build the Java runtime and install the Python package:

mvn clean package -Prelease
python -m pip install .\src\main\python

The installed package contains the bundled Ghostwriter JAR, so callers do not need to configure a Java class path.

Usage

Run the console command or module entry point:

mgw --help
python -m mgw --help

Call the wrapper from Python:

from mgw import gw

result = gw(["--help"])
print(result)

gw forwards arguments to Ghostwriter without Python-side command-line parsing and returns the processor result as a string. If called without an argument list, it forwards the current process arguments after the executable name. The JVM starts on first use and is reused for later calls.

The package also exposes gdp for processing guidance tags and adw for executing an Act:

from mgw import adw, gdp

report = gdp(path="src")
results = adw("my-act", path="src")

Additional Java libraries can be supplied as local JAR paths or Maven coordinates (groupId:artifactId:version). Maven coordinates are resolved and downloaded by jgo before the JVM starts:

report = gdp(
    path="src",
    libs=["com.example:example-library:1.0.0", "lib/custom-tools.jar"],
)

Building the Python distribution

After building the Java runtime, build the wheel and source distribution from the Python package directory:

mvn clean package -Prelease
Set-Location src/main/python
python -m pip install --upgrade build
python -m build

Artifacts are written to src/main/python/dist.

License

Apache License, Version 2.0.

Metadata

Release files for mgw 1.4.2

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

Source distribution (sdist)

Source distribution for mgw 1.4.2
File Size Uploaded Provenance Actions
mgw-1.4.2.tar.gz 59.0 MB Without provenance Details for mgw-1.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 118.0 MB

Release files / mgw-1.4.2.tar.gz

Download URL mgw-1.4.2.tar.gz
Size 59.0 MB
Tags Source
SHA-256 checksum
How to use checksums
5974fe08f9f30d0a6f106111acc1c495b3266073cd99046c716b60125999a123
BLAKE2b-256 checksum
How to use checksums
476c2ce6c77ecbd22cddd30368e6e652123c6caf813b784c7d4f853aa38ba37e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / mgw-1.4.2-py3-none-any.whl

Download URL mgw-1.4.2-py3-none-any.whl
Size 59.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1955874ccf89120b18051b1da69df62b47622a4d29f7a2676bf906b6f7e5c382
BLAKE2b-256 checksum
How to use checksums
0e2d478c3e79050a6c48188322d1098b3fcbbef840bab4399ece92e37d3ee746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for mgw 1.4.2

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.

Release history Release notifications | RSS feed

This release

1.4.2 This release

2 release files No provenance

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