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.3

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.3
File Size Uploaded Provenance Actions
mgw-1.4.3.tar.gz 100.5 MB Without provenance Details for mgw-1.4.3.tar.gz

Built distribution (wheel)

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

Total release size: 201.0 MB

Release files / mgw-1.4.3.tar.gz

Download URL mgw-1.4.3.tar.gz
Size 100.5 MB
Tags Source
SHA-256 checksum
How to use checksums
8a93b342741fdfad8c9076c4cff1abf153e0238cad20a7ba0656652fa724dec8
BLAKE2b-256 checksum
How to use checksums
3df00af2d3b7575184b8c3574f46c6dd52e1bdc82b1633540ff657394d02f8a8
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.3-py3-none-any.whl

Download URL mgw-1.4.3-py3-none-any.whl
Size 100.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7703680b988c8c936267e88ca0f999b0219068dacf8e271309c0ef3c2151ae84
BLAKE2b-256 checksum
How to use checksums
22897f2d6cd9969704aa6cbcb5aeb85586930fe3d56dcf7bf3e80ce38b0d68aa
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.3

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.3 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