ezdwf
ezdwf is an experimental, read-only Python library for parsing 2D Autodesk
DWF and DWFx files. Its parser is written in Rust and exposes drawings through
an ezdxf-style Python API.
The library reads source formats directly without converting them to DXF. It provides both a normalized paper-space model for application code and access to the underlying DWF, W2D, OPC, and XPS records when lower-level data is needed.
Installation
Python 3.10 or later is required. From PYPI.
pip install ezdwf
From a source checkout, run:
python -m pip install .
Building from source also requires a Rust toolchain.
Install the optional Matplotlib renderer with:
python -m pip install "ezdwf[plot]"
Quick start
import ezdwf
drawing = ezdwf.read("drawing.dwf")
sheet = drawing.modelspace()
print(drawing.stats())
for entity in sheet.query('LINE POLYLINE[layer=="Walls", visible==true]'):
print(entity.dxftype(), entity.layer, entity.points)
sheet.save_svg("drawing.svg")
Matplotlib can be used for interactive inspection or raster/PDF output:
figure, axes = ezdwf.plot(drawing, include_markup=True)
figure.savefig("drawing.png", dpi=150, bbox_inches="tight")
# Or render and close the figure in one call.
ezdwf.save_plot(drawing, "drawing.png", dpi=150, include_markup=True)
Multi-sheet drawings can be accessed by index, page name, or title:
first_sheet = drawing.sheet(0)
named_sheet = drawing.sheet("Floor Plan")
A large plot set can be read one chunk of entities at a time. The drawing
stays in the Rust core; reader.sheets carry names, paper and bounds but no
entities, and reader.entities(index) yields one sheet's entities in order:
reader = ezdwf.open_drawing("plot-set.dwfx")
for index, sheet in enumerate(reader.sheets):
for entity in reader.entities(index):
...
Pass consume=True when every sheet is read once, as a converter does: each
chunk of entities is then released from the Rust core as it is yielded and the
freed memory goes back to the operating system, so the drawing's footprint
shrinks while your own objects grow instead of both peaking together. The
released entities' records go too, in batches and whole once a sheet is
finished (a plot set of 1.7 million short polylines otherwise kept 700 MB of
empty records until the reader was dropped). Dropping the reader returns the
rest of the package the same way (read does so as soon as its dataclasses are
built), so a long-running process keeps only its live data.
ezdwf.read(..., keep_raw=False) likewise leaves out the raw W2D / XPS
records, a second copy of every entity.
Command line
ezdwf inspect drawing.dwf
ezdwf inspect drawing.dwf --json
ezdwf render drawing.dwf drawing.svg --sheet 0
ezdwf plot drawing.dwf drawing.png --sheet 0 --dpi 150
Run ezdwf --help or ezdwf <command> --help for all options.
Supported input
- Legacy 2D DWF/WHIP streams (
(DWF V00.17),V00.25,V00.30,V00.34,V00.36,V00.42,V00.50,V00.55), including the WHIP! 2.0-era operand layouts of revisions before 00.33: the counted-name Set Font, the Draw Text forms that carry rotation, height and the other font metrics inline, and BGRA binary colors - Bare
(W2D V06.xx)graphics streams that are not wrapped in a DWF 6 package (for example a.w2dresource saved with a.dwfextension); they are read like a legacy single-stream file and reportkind == "w2d_stream" - DWF 6 packages containing ePlot/W2D resources
- DWFx packages containing OPC/OpenXPS fixed pages
When a W2D resource contains a record the decoder cannot read (an unknown
opcode or operands that do not parse), the entities decoded before it are kept,
the rest of that resource is skipped, and a W2D_STREAM_TRUNCATED warning is
added to drawing.diagnostics (details: opcode, consumed_bytes,
decoded_bytes, consumed_percent, entities_kept, error). A resource that
yields nothing drawable before the failure still raises the original error,
and resource limits always fail closed.
Common 2D geometry, layers, colors, line and fill styles, text, raster images, clips, opacity masks, gradients, Canvas groups, and VisualBrush resources are represented in the normalized model. DWFx package fonts can be decoded into positioned glyph outlines. Drawings can be queried by entity type and style and rendered to deterministic SVG without additional runtime dependencies.
For package inspection without normalization, use the lower-level API:
package = ezdwf.inspect_package("drawing.dwf")
dwfx = ezdwf.inspect_dwfx("drawing.dwfx")
# Glyph outlines are opt-in for structure-only DWFx inspection.
dwfx_with_outlines = ezdwf.inspect_dwfx(
"drawing.dwfx",
resolve_glyph_outlines=True,
)
Coordinates
High-level entities use the sheet's paper units in a bottom-left, Y-up coordinate system. DWFx pages use device-independent pixels (DIP), where 96 DIP equals one inch. Raw objects retain their source coordinate systems and transforms.
See the object model documentation for details.
Limitations
- The API is read-only and is still pre-alpha.
- Support is focused on 2D ePlot content; 3D DWF content is outside the current scope.
- SVG output is a reference preview. Some color-profile brushes, JPEG XR image details, and format-specific embedded fonts cannot yet be rendered exactly.
- Matplotlib output uses representative colors for complex XPS gradient, ImageBrush, and VisualBrush paints and applies the first path in a clip chain.
- Unsupported or ambiguous source semantics are reported through diagnostics instead of being silently approximated.
ParseLimits.max_w2d_entities(default 500,000 per W2D resource) is a soft limit: the drawables decoded before it are kept, the rest of that resource is skipped, and aW2D_ENTITY_LIMIT_TRUNCATEDwarning is reported. Raise it for very large plots when enough memory is available; the other limits still fail closed.
License
This project is licensed under the MIT License.
Metadata
Release files for ezdwf 0.0.16
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 |
|---|---|---|---|---|
| ezdwf-0.0.16.tar.gz | 183.8 kB | With provenance | Details for ezdwf-0.0.16.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| ezdwf-0.0.16-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for ezdwf-0.0.16-cp310-abi3-win_amd64.whl |
| ezdwf-0.0.16-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for ezdwf-0.0.16-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| ezdwf-0.0.16-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for ezdwf-0.0.16-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| ezdwf-0.0.16-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) | Details for ezdwf-0.0.16-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
Total release size: 6.0 MB
Release files / ezdwf-0.0.16.tar.gz
| Download URL | ezdwf-0.0.16.tar.gz |
|---|---|
| Size | 183.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2455e289bc87f4a8a2bfc242cf99a1770ca9eea26c05b5a541a295b7cdc41950
|
|
BLAKE2b-256 checksum How to use checksums |
8854560a7faf05558e77dcdd6201f354f3de827695487b6b30d640df3d440002
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 9, 2026.
Transparency logRelease files / ezdwf-0.0.16-cp310-abi3-win_amd64.whl
| Download URL | ezdwf-0.0.16-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ee1ec81d3ddf958cc6b1d4efdf6e36e3ea8945f669feae598fe31f0281e0bf28
|
|
BLAKE2b-256 checksum How to use checksums |
bf2717b579c65a2c58038a1d92849029397cfad02aee24bdfa54848e506466da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 9, 2026.
Transparency logRelease files / ezdwf-0.0.16-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | ezdwf-0.0.16-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3d507bcb3a1a96f84176bdb5e262221297fcb3f8e554f0c48c7bc6d1a3343777
|
|
BLAKE2b-256 checksum How to use checksums |
21075469467eb288312ce33d2141147e170d44e024f8c65ccefa1abf991962c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 9, 2026.
Transparency logRelease files / ezdwf-0.0.16-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | ezdwf-0.0.16-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7bd32f2d656a05b140e7a4c679d42b45a5fac99ea9e59524c674da6ed40e6cdd
|
|
BLAKE2b-256 checksum How to use checksums |
8dc436e4a173d939cc6f2a9568c402f3aed2a0b777e2db837812bd72c6f562d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 9, 2026.
Transparency logRelease files / ezdwf-0.0.16-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | ezdwf-0.0.16-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fede574e08eb37675987c88494db4b06ad5120ec66ea3648826fcaa75fa60f3b
|
|
BLAKE2b-256 checksum How to use checksums |
a3816379fe1b3a927daa401cb82fe5e7c1fe6a13512c98f555791e905fed29a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 9, 2026.
Transparency logSecurity for ezdwf 0.0.16
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 5 files in this release have been uploaded with provenance metadata.
Attestation for ezdwf-0.0.16.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 Nov 9, 2026.
Transparency logA 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.