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
.jwwfiles. - Read document/header data from Python.
- Convert parsed JWW entities to DXF intermediate entities.
- Write ASCII DXF files.
- Emit DXF handles,
BLOCK_RECORDtable, andOBJECTSsection for better CAD compatibility.
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
Optional plotting dependency
pip install "ezjww[plot]"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ezjww-0.1.0.tar.gz.
File metadata
- Download URL: ezjww-0.1.0.tar.gz
- Upload date:
- Size: 425.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a106625311439984c40cf76fc200d75f5e0e995c571534b9aef5a81ceafee41e
|
|
| MD5 |
d18727eaef25bcc9eb6ec67809bd89a5
|
|
| BLAKE2b-256 |
8e7accbe0e9bdc2d843d75fe823bb379691c569b264867d3457afca53c4a067c
|
File details
Details for the file ezjww-0.1.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: ezjww-0.1.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 347.2 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58900f41dd3a8cbc20c3ec1bd71fe42c9cf8543a2de63b76ba951c6525b686f9
|
|
| MD5 |
039de9e721a3756f42664e5846184f48
|
|
| BLAKE2b-256 |
940ed6e7c7258adb18ab2db012ed5c844492a641d14bdcf63320ea3eddacb69b
|
File details
Details for the file ezjww-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ezjww-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 444.1 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c4700d3818b9b7f1f3981f62545063586f31ddc9d3638850d75507db51f12ad
|
|
| MD5 |
7f912d51914500c880382c4b5485988f
|
|
| BLAKE2b-256 |
cd88ede5c1ad8b03ceacd397033515a1e61d75fcda3fabe32e4a93bcc22bcdc1
|
File details
Details for the file ezjww-0.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: ezjww-0.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 802.2 kB
- Tags: CPython 3.9+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ecedfff332e6715b60cb7c5ce89f5fe3ab11ddbaa6a4c1a12b3805681e8f646
|
|
| MD5 |
4611339432bb4e29df9722aae39bfb11
|
|
| BLAKE2b-256 |
27b6ddc6c3e0ed6212a60e14d8a3e08d6b09659a9f9fd09554b4816f022a03b2
|