Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ezhpgl

A Rust-backed HP-GL and HP-GL/2 parser for Python. Read plot files, inspect their geometry and source commands, and export JSON or SVG.

  • Lines, encoded polylines, arcs, ellipses, Bézier curves, polygons and hatch fills.
  • Pen attributes, coordinate transforms, clipping and separate plot pages.
  • Labels with original bytes, placement information and substitute-font previews.
  • A documented subset of PCL/PJL containers, with diagnostics for omitted content.
  • Read-only Python objects, source byte ranges and configurable resource limits.

Installation

Requires CPython 3.10 or newer. This is an alpha release:

python -m pip install --pre ezhpgl

Conventional GIL-enabled CPython is supported. Building from source requires Rust 1.85 or newer and maturin; see development.

Quick start

import ezhpgl

plot = ezhpgl.parse(b"IN;SP1;PA0,0;PD1600,0,1600,800,0,800,0,0;PU;")
print(plot.completeness, plot.stats())
plot.write_svg("drawing.svg")
plot.write_json("drawing.json")

# Or read a file:
# plot = ezhpgl.readfile("drawing.plt")
for page in plot.pages:
    for operation in page.operations:
        print(operation.geometry.kind, operation.style.pen, operation.source.span)

Coordinates are physical millimetres, with Y pointing up. The generic profile uses 40 plotter units per millimetre. Paper size and plot extents are unknown unless supplied explicitly:

profile = ezhpgl.DeviceProfile(plot_size_mm=(200, 100), paper_size_mm=(210, 297))
plot = ezhpgl.readfile("drawing.plt", profile=profile)

plot_size_mm supplies the hard clipping rectangle and default scaling points. paper_size_mm is separate metadata. Nonzero RO and percentage IR need known plot extents. See profile rules.

Command line

ezhpgl inspect drawing.hpgl
ezhpgl commands drawing.hpgl --tolerant
ezhpgl export drawing.plt --format svg --page 1 -o drawing.svg
ezhpgl export drawing.plt --format json -o drawing.json

export interprets geometry and supported containers. inspect and commands inspect standalone command syntax. Exit codes are 0 for complete, 2 for a partial result, and 1 for an error. See CLI options.

Supported scope and limitations

The parser uses an explicit generic plotter profile. It does not emulate every printer or recover the original CAD layers, dimensions or model scale.

  • PS sets the plot extents; the larger value is the X extent (length), as on HP devices, and one argument means square extents in this device-independent profile. Device-control commands are accepted without effect; fill anchors, user line types, tick marks and HP-GL/1 character sets are ignored with the nonfatal IGNORED_COMMAND diagnostic.
  • Text previews use substitute fonts. Native fonts, Japanese/multibyte labels, and downloaded fonts are unsupported.
  • PCL/PJL support is limited. Supported raster blocks are omitted with diagnostics; HP RTL image decoding and full printer emulation are unsupported.
  • Unsupported commands raise in strict mode. With strict=False, interpretation stops at the first uncertain command and returns the valid prefix as partial.
  • Known text approximations and omissions can also produce partial in strict mode while interpretation continues. Inspect diagnostic codes and actions.
  • A .plt extension does not establish the file format. Raw lexical completeness does not imply that all commands can be interpreted or rendered.

See the support matrix for command-level coverage.

Documentation

License

MIT. The parser is independently implemented in Rust with PyO3 bindings.

Metadata

Release files for ezhpgl 0.1.0a3

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

Source distribution (sdist)

Source distribution for ezhpgl 0.1.0a3
File Size Uploaded Provenance Actions
ezhpgl-0.1.0a3.tar.gz 118.0 kB With provenance Details for ezhpgl-0.1.0a3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ezhpgl 0.1.0a3
File Actions
ezhpgl-0.1.0a3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for ezhpgl-0.1.0a3-cp310-abi3-win_amd64.whl
ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_x86_64.whl
ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_aarch64.whl
ezhpgl-0.1.0a3-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for ezhpgl-0.1.0a3-cp310-abi3-macosx_11_0_arm64.whl
ezhpgl-0.1.0a3-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for ezhpgl-0.1.0a3-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 2.6 MB

Release files / ezhpgl-0.1.0a3.tar.gz

Download URL ezhpgl-0.1.0a3.tar.gz
Size 118.0 kB
Tags Source
SHA-256 checksum
How to use checksums
737bba153954628500fdcc4391d5268f8b38c7ddb16229395cecc1548e69829a
BLAKE2b-256 checksum
How to use checksums
c65ff3dae09d9bb0c2b52b45c48f88fe816420e72216b5c9fd97fdb045da0d4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / ezhpgl-0.1.0a3-cp310-abi3-win_amd64.whl

Download URL ezhpgl-0.1.0a3-cp310-abi3-win_amd64.whl
Size 381.2 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
aa3bc36172bbc316b629408ee52c09dbdba9bd102ae93db17196daaa3b7253c7
BLAKE2b-256 checksum
How to use checksums
205eb911eb912272cc246e71c84d5ad48d659bcc63cc52aca102527bd02ba1c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_x86_64.whl
Size 544.8 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
780e70fe53a3a8b95b7ce650104727bab508b49aaa6393efda25fa5e2d96ecde
BLAKE2b-256 checksum
How to use checksums
79c9c209d2aaa9e0fe1040bc8b7fbe9b985655fe643c3b8874ae87c95c90c02b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL ezhpgl-0.1.0a3-cp310-abi3-manylinux_2_28_aarch64.whl
Size 537.8 kB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
bad73e9945f3b16c73c1061b0882af62d79242c7619338ac1ad76aa76f9fbfc3
BLAKE2b-256 checksum
How to use checksums
4d319f16dfdccb48e4cc6078ca4885df11e19b3a7c411f2b714925f06ec50d78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / ezhpgl-0.1.0a3-cp310-abi3-macosx_11_0_arm64.whl

Download URL ezhpgl-0.1.0a3-cp310-abi3-macosx_11_0_arm64.whl
Size 485.7 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
43604d329449b18e24da996cf0e29e0289de1bca9177cea162a808e0675aed51
BLAKE2b-256 checksum
How to use checksums
e83c1c0b9df2db5966f7b80098c9046ec9af84952538ae6138181e67e2849c15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / ezhpgl-0.1.0a3-cp310-abi3-macosx_10_12_x86_64.whl

Download URL ezhpgl-0.1.0a3-cp310-abi3-macosx_10_12_x86_64.whl
Size 482.7 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f70577444645656e8088c2a907205aa045bca07da2fe789c00efb483d77dcd75
BLAKE2b-256 checksum
How to use checksums
dd06dc86e7931b06954ad7e5f1750adf466d547e8a1b2dc07a522073841c6f54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for ezhpgl 0.1.0a3

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for ezhpgl-0.1.0a3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

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.

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