saxonhe4py
A packaged Java Saxon HE for Python.
Install
Java Saxon HE is made easy to install as a single Python package:
pip install saxonhe4py
Usage
>>> from saxonhe4py import SAXON_HE_JAR
>>> SAXON_HE_JAR
PosixPath('/Users/johndoe/dev/saxonhe4py/jdk4py/java-runtime')
Command line
>>> from subprocess import check_output, run, STDOUT
>>> from jdk4py import JAVA
>>> from saxonhe4py import SAXON_HE_JAR
>>>
>>> cmd_list = [str(JAVA), "-jar", str(SAXON_HE_JAR), "net.sf.saxon.Transform", "-t", "-?"]
>>> print(check_output(cmd_list, stderr=subprocess.STDOUT, text=True))
SaxonJ-HE 11.4 from Saxonica
Java version 17.0.3
...
With jsaxonpy
Could be convinient if you want to execute your code as cloud function where there is no java VM nor Saxon are avaiable in the environment of the container.
import os
from jdk4py import JAVA
from saxonhe4py import SAXON_HE_JAR
from jsaxonpy import Xslt
os.environ.update({
"JVM_OPTIONS": os.environ.get("JVM_OPTIONS", "-Xmx64m"),
"CLASSPATH": os.environ.get("CLASSPATH", "") + os.pathsep + str(SAXON_HE_JAR),
"PATH": os.environ.get("PATH", "") + os.pathsep + str(JAVA)
})
xml = "<root><child>text</child></root>"
xsl = """
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
"""
t = Xslt()
print(t.transform(xml, xsl))
Versioning
saxonhe4py's version contains 3 numbers:
- The first 2 numbers are the Java Saxon HE version.
- The third is
saxonhe4pyspecific: it starts at 0 for each Java Saxon HE version and then increases.
Metadata
Release files for saxonhe4py 11.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| saxonhe4py-11.4.0.tar.gz | 6.5 MB | Without provenance | Details for saxonhe4py-11.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| saxonhe4py-11.4.0-py3-none-any.whl | Python 3 | none | any | Details for saxonhe4py-11.4.0-py3-none-any.whl |
Total release size: 13.1 MB
Release files / saxonhe4py-11.4.0.tar.gz
| Download URL | saxonhe4py-11.4.0.tar.gz |
|---|---|
| Size | 6.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eeb0e6ecdad86a19c646a8564f0f94cb94e1e80b3c80cad5cc318497ef5e34b8
|
|
BLAKE2b-256 checksum How to use checksums |
60f6a616298edd9fe69aaf5734d31c5f5affbed19ecf106dd710454b69f32345
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / saxonhe4py-11.4.0-py3-none-any.whl
| Download URL | saxonhe4py-11.4.0-py3-none-any.whl |
|---|---|
| Size | 6.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b0c335f0c8d9444f606197163bb418fe89331654f7fb63a75b5c4c2ff812e45
|
|
BLAKE2b-256 checksum How to use checksums |
83efa18770eaf4410e5bbd638d7eaa6a3cdce24b7a38d4cbd665dae9fa4e30bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for saxonhe4py 11.4.0
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.