Skip to main content

Add your description here

Project description

ezjww

ezjww is a JWW parser and DXF conversion library. The core parser/writer is implemented in Rust and exposed to Python with PyO3.

Current Features

  • Validate and parse .jww files.
  • Read document/header data from Python.
  • Convert parsed JWW entities to DXF intermediate entities.
  • Write ASCII DXF files.
  • Emit DXF handles, BLOCK_RECORD table, and OBJECTS section for better CAD compatibility.

Installation

Install the package from PyPI:

pip install ezjww

If you want to use the optional plotting feature, install the package with the plot extra:

pip install "ezjww[plot]"

Install the package from source:

git clone https://github.com/neka-nat/ezjww.git
cd ezjww
uv sync

Python API

from ezjww import (
    audit,
    bbox,
    is_jww_file,
    readfile,
    plot_jww,
    read_document,
    read_dxf_document,
    report,
    stats,
    to_dxf_string,
    write_dxf,
)

ok = is_jww_file("sample.jww")
doc = read_document("sample.jww")
dxf_doc = read_dxf_document("sample.jww")
dxf_text = to_dxf_string("sample.jww")
write_dxf("sample.jww", "sample.dxf")
plot_jww("sample.jww", save_path="sample.png")

drawing = readfile("sample.jww")
msp = drawing.modelspace()
lines = msp.query("LINE", layer="#lv4")
mix = msp.query('LINE POINT[layer=="#lv4", color==5]')  # ezdxf-like selector
extents = drawing.bbox(explode_inserts=True)
raw_dxf = drawing.to_dxf_string()
dist = drawing.stats()
health = drawing.audit()  # or: audit("sample.jww")
full = report("sample.jww", explode_inserts=True)

# expand INSERT references (nested block aware)
flat = drawing.to_dxf(explode_inserts=True, max_block_nesting=32)
flat_count = len(flat["entities"])
# max_block_nesting must be >= 1

CLI

The package installs the ezjww command.

# show summary
ezjww info jww_samples/Test1.jww

# run health checks
ezjww audit jww_samples/Test1.jww --json

# calculate drawing extents
ezjww bbox jww_samples/Test1.jww --json --explode-inserts

# show entity distribution
ezjww stats jww_samples/Test1.jww --json

# show combined audit+bbox+stats
ezjww report jww_samples/Test1.jww --json --explode-inserts

# convert one file
ezjww to-dxf jww_samples/Test1.jww -o /tmp/Test1.dxf

# convert one file + JSON report
ezjww to-dxf jww_samples/Test1.jww -o /tmp/Test1.dxf --report json

# convert one file with INSERT expansion
ezjww to-dxf jww_samples/Test1.jww -o /tmp/Test1.dxf --explode-inserts

# convert directory (recursive)
ezjww to-dxf-dir jww_samples -o /tmp/dxf_out -r

# render with matplotlib
ezjww plot jww_samples/Test1.jww -o /tmp/Test1.png --explode-inserts

Development

cargo fmt --all
cargo test
maturin develop

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

ezjww-0.2.0.tar.gz (450.9 kB view details)

Uploaded Source

Built Distributions

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

ezjww-0.2.0-cp39-abi3-win_amd64.whl (346.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

ezjww-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (438.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

ezjww-0.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (799.9 kB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file ezjww-0.2.0.tar.gz.

File metadata

  • Download URL: ezjww-0.2.0.tar.gz
  • Upload date:
  • Size: 450.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for ezjww-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b66e331732d2af203a726c277ee0c30a21646909e01df030cd399e4d07123857
MD5 8094d0f4b3284925148c872d9d8b46fb
BLAKE2b-256 ca92201d52f525ff993e39a1def1d26e194525532da78c56581d30b1b44a5393

See more details on using hashes here.

File details

Details for the file ezjww-0.2.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: ezjww-0.2.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 346.5 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for ezjww-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 72ac0ea9a236d037ae339bd6600e5736d3968c62e414e56c2a2cba388a2b5647
MD5 ae8295af8aa6d34e686baeb6a84ab780
BLAKE2b-256 f575aa0f790839be5331c422ae3828190953728ad53e6bf8c037fc0e3bfadb59

See more details on using hashes here.

File details

Details for the file ezjww-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ezjww-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b1c09b1f48f631ae95168a6f4720b98a18b17d3382fabf16be546214ad6d5db6
MD5 c02587836f491bde003aa475417eb0ac
BLAKE2b-256 7bf8e9779a5e0f3132f16816ceb9fcc9d8c4a87522a5aca183e9b0caa5baad52

See more details on using hashes here.

File details

Details for the file ezjww-0.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for ezjww-0.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 309619bcc3fde1579f07b780cd8bd84d457b1b2cc4108f5b2c2cd8ec99603e6d
MD5 b35bf02a539e5f2dc43fd5758fbf76a5
BLAKE2b-256 a8e595250695d7ff7c60d9ff2dc61524946269cbd329c1f81fb039701906a473

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