Skip to main content

ezjww

ezjww reads Jw_cad drawings and converts them to DXF. Its Rust core is available through Python and TypeScript/WebAssembly.

  • Read JWW files and a limited binary JWC profile.
  • Inspect source records, headers, layers, and parsing diagnostics.
  • Query converted geometry, calculate bounds, and audit drawings.
  • Export ASCII DXF (AC1015 or AC1024) and render PNG/PDF previews.
  • Convert individual files or directories from the command line.

Installation

Python 3.9 or later:

pip install ezjww

For previews, install the optional Matplotlib dependency:

pip install "ezjww[plot]"

For Node.js, see the TypeScript package:

npm install ezjww

To build the Python package from source, install a Rust toolchain, then run:

git clone https://github.com/monozukuri-ai/ezjww.git
cd ezjww
pip install .

Python quick start

readfile detects JWW or JWC from the file contents. Replace drawing.jww with your input path; the same API accepts supported .jwc files.

import ezjww

drawing = ezjww.readfile("drawing.jww")
print(drawing.source_format, drawing.header)
print(drawing.stats())
print(drawing.bbox())

lines = drawing.modelspace().query("LINE")
health = drawing.audit()
for diagnostic in health["diagnostics"]:
    print(diagnostic["code"], diagnostic["details"])

drawing.saveas("drawing.dxf", target_version="AC1024")

Use read_cad_document when you need the original records. Its return value identifies the format and contains the corresponding source document:

import ezjww

cad = ezjww.read_cad_document("drawing.jwc")
source = cad["document"]
print(cad["format"], source["entity_counts"])

# JWC DXF geometry defaults to paper millimeters. Select model millimeters
# to apply each entity's layer-group scale.
model = ezjww.readfile("drawing.jwc", jwc_coordinates="model_millimeters")
model.saveas("drawing-model.dxf")
print(model.report()["jwc_conversion_report"]["notices"])

The JWW-specific read_document and read_header keep their original meanings. Use read_jwc_document and read_jwc_header for JWC-specific reads. See the API reference for format detection, coordinate options, errors, and conversion metadata.

Queries and previews

import ezjww

drawing = ezjww.readfile("drawing.jww")
entities = drawing.modelspace().query('LINE POINT[layer=="#lv4", color==5]')
flat = drawing.to_dxf(explode_inserts=True, max_block_nesting=32)

drawing.plot(save_path="drawing.png")  # requires ezjww[plot]
drawing.plot(save_path="drawing.pdf")

DXF TEXT records include a width factor (group 41). For JWW, it is estimated from the stored endpoint span and half/full-width character cells. Actual glyph advances depend on the selected font; this is not an exact fit for every font substitution. JWC retains its existing width/height ratio.

Use text_em_scale when a target renderer draws a larger em box per unit of DXF text height. It must be positive and finite; the default is 1.0. This divides the exported text height (group 40). A value such as 1.364 is an example that must be measured for the renderer and font, not a universal correction.

scaled = drawing.to_dxf(text_em_scale=1.364)
ezjww.write_dxf("drawing.jww", "drawing.dxf", text_em_scale=1.364)
drawing.plot(text_em_scale=1.364, save_path="drawing.png")

Previews apply the width factor to glyphs before rotation and recover the source em height from text_em_scale. They use the locally available font, so they may differ from an external DXF viewer. Audit, bounding-box and statistics queries retain their existing defaults.

Block expansion supports nested JWW INSERTs; max_block_nesting must be at least

  1. Statistics and bounding boxes include hidden entities. TEXT bounds use the insertion point, so they are not bounds of the rendered glyphs.

Command line

The Python package installs the ezjww command. Each single-file command below accepts JWW and supported JWC input.

ezjww info drawing.jww --json
ezjww audit drawing.jwc --json
ezjww bbox drawing.jwc --jwc-coordinates model_millimeters --json
ezjww stats drawing.jww --json
ezjww report drawing.jwc --json
ezjww to-dxf drawing.jwc -o drawing.dxf --report json
ezjww to-dxf drawing.jww -o drawing.dxf --text-em-scale 1.364
ezjww to-dxf-dir drawings -o dxf --recursive
ezjww plot drawing.jwc -o drawing.png

Use ezjww --help or ezjww <command> --help for options. Audit/report commands support --fail-on-issues for automation. Rendering requires ezjww[plot].

Directory conversion finds .jww and .jwc case-insensitively and preserves subdirectories. If inputs would share an output name (for example, a.jww and a.jwc), it exits with code 2 before writing any converted files.

Compatibility

JWW parsing supports CP932 and Unicode strings, block definitions, and structured diagnostics. Some damaged JWW entity lists can be read partially; inspect diagnostics before relying on the result.

JWC support is restricted to the fixed2421_basic_v1 document profile. It includes lines, circles, circular arcs, full rotated ellipses, CP932 text, points, and auxiliary points. Partial ellipses and unknown layouts or attributes are rejected. Malformed JWC files raise an error instead of returning a partial document. Compatibility with all JWC generations, including old DOS files, is not established.

JWC output uses millimeters, with the sheet center as the origin and +Y pointing up. Palette, dash lengths, and fonts use documented conversion defaults; exact source fonts and character spacing are not reproduced. The source format version is unknown and returned as None in Python or null in TypeScript.

Documentation

License

MIT

Metadata

Release files for ezjww 0.3.0

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

Source distribution (sdist)

Source distribution for ezjww 0.3.0
File Size Uploaded
ezjww-0.3.0.tar.gz 955.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ezjww 0.3.0
File Interpreter ABI Platform
ezjww-0.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
ezjww-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
ezjww-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details

Total release size: 3.3 MB

Release files / ezjww-0.3.0.tar.gz

Download URL ezjww-0.3.0.tar.gz
Size 955.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4dac5733e19f9f7ea69635018a0ffd2aa6896c5bfbb5f170b5f23977c788795a
BLAKE2b-256 checksum
How to use checksums
b4df6df2e4ec92f26b08721dc4c9ebdcc029c135e5c01eadff9799599b9b71e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ezjww-0.3.0-cp39-abi3-win_amd64.whl

Download URL ezjww-0.3.0-cp39-abi3-win_amd64.whl
Size 503.7 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
243814c16ed22f76fc344c797fdf5dc049b584e433cad6150bfa16bc4138d19f
BLAKE2b-256 checksum
How to use checksums
b492f30ec44826c621d9b0feb57c0b16c7efa74551a576bae66bb19d8fbd959c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ezjww-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ezjww-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 659.7 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
9bdda9425a3ae11cbd907b138f9f4c81616c75c347383e3319fc85306be50d69
BLAKE2b-256 checksum
How to use checksums
8b7ee39a169c86162350ca84ccc6f48eb849226f8e85479569c538a12ce1ebc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ezjww-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL ezjww-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 1.2 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
815b55797e567a67802b6f54012ba84154df8f2a9523e811a119eeda151e35ce
BLAKE2b-256 checksum
How to use checksums
d5d308dc6d9e2f9ab8136709c3b261da8c074f99bb947ba86d2f136956c3f7b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.5.0

4 release files

0.4.0

4 release files

0.3.4

4 release files

0.3.3

4 release files

0.3.2

4 release files

0.3.1

4 release files

This release

0.3.0 This release

4 release files

0.2.12

4 release files

0.2.11

4 release files

0.2.10

4 release files

0.2.9

4 release files

0.2.8

4 release files

0.2.7

4 release files

0.2.6

4 release files

0.2.5

4 release files

0.2.4

4 release files

0.2.3

4 release files

0.2.2

4 release files

0.2.1

4 release files

0.2.0

4 release files

0.1.0

4 release files

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