ezdwf 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. ezdwf-0.0.1/Cargo.lock +372 -0
  2. ezdwf-0.0.1/Cargo.toml +19 -0
  3. ezdwf-0.0.1/LICENSE +21 -0
  4. ezdwf-0.0.1/PKG-INFO +131 -0
  5. ezdwf-0.0.1/README.md +100 -0
  6. ezdwf-0.0.1/crates/ezdwf-core/Cargo.toml +26 -0
  7. ezdwf-0.0.1/crates/ezdwf-core/src/dwfx/font.rs +616 -0
  8. ezdwf-0.0.1/crates/ezdwf-core/src/dwfx/mod.rs +11 -0
  9. ezdwf-0.0.1/crates/ezdwf-core/src/dwfx/model.rs +489 -0
  10. ezdwf-0.0.1/crates/ezdwf-core/src/dwfx/parser.rs +4127 -0
  11. ezdwf-0.0.1/crates/ezdwf-core/src/dwfx/path.rs +462 -0
  12. ezdwf-0.0.1/crates/ezdwf-core/src/dwfx/raster.rs +354 -0
  13. ezdwf-0.0.1/crates/ezdwf-core/src/error.rs +223 -0
  14. ezdwf-0.0.1/crates/ezdwf-core/src/format.rs +176 -0
  15. ezdwf-0.0.1/crates/ezdwf-core/src/lib.rs +68 -0
  16. ezdwf-0.0.1/crates/ezdwf-core/src/model.rs +175 -0
  17. ezdwf-0.0.1/crates/ezdwf-core/src/normalized.rs +1738 -0
  18. ezdwf-0.0.1/crates/ezdwf-core/src/options.rs +92 -0
  19. ezdwf-0.0.1/crates/ezdwf-core/src/package/archive.rs +306 -0
  20. ezdwf-0.0.1/crates/ezdwf-core/src/package/eplot.rs +309 -0
  21. ezdwf-0.0.1/crates/ezdwf-core/src/package/manifest.rs +267 -0
  22. ezdwf-0.0.1/crates/ezdwf-core/src/package/mod.rs +105 -0
  23. ezdwf-0.0.1/crates/ezdwf-core/src/package/path.rs +75 -0
  24. ezdwf-0.0.1/crates/ezdwf-core/src/package/xml.rs +215 -0
  25. ezdwf-0.0.1/crates/ezdwf-core/src/w2d/ascii.rs +239 -0
  26. ezdwf-0.0.1/crates/ezdwf-core/src/w2d/compression.rs +516 -0
  27. ezdwf-0.0.1/crates/ezdwf-core/src/w2d/decoder.rs +3605 -0
  28. ezdwf-0.0.1/crates/ezdwf-core/src/w2d/mod.rs +11 -0
  29. ezdwf-0.0.1/crates/ezdwf-core/src/w2d/model.rs +261 -0
  30. ezdwf-0.0.1/crates/ezdwf-python/Cargo.toml +18 -0
  31. ezdwf-0.0.1/crates/ezdwf-python/src/lib.rs +2059 -0
  32. ezdwf-0.0.1/pyproject.toml +56 -0
  33. ezdwf-0.0.1/src/ezdwf/__init__.py +188 -0
  34. ezdwf-0.0.1/src/ezdwf/__main__.py +208 -0
  35. ezdwf-0.0.1/src/ezdwf/_core.pyi +121 -0
  36. ezdwf-0.0.1/src/ezdwf/document.py +1447 -0
  37. ezdwf-0.0.1/src/ezdwf/py.typed +1 -0
  38. ezdwf-0.0.1/src/ezdwf/raw.py +1552 -0
  39. ezdwf-0.0.1/src/ezdwf/svg.py +1922 -0
ezdwf-0.0.1/Cargo.lock ADDED
@@ -0,0 +1,372 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "adler2"
7
+ version = "2.0.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
10
+
11
+ [[package]]
12
+ name = "arbitrary"
13
+ version = "1.4.2"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1"
16
+ dependencies = [
17
+ "derive_arbitrary",
18
+ ]
19
+
20
+ [[package]]
21
+ name = "cfg-if"
22
+ version = "1.0.4"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
25
+
26
+ [[package]]
27
+ name = "crc32fast"
28
+ version = "1.5.0"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
31
+ dependencies = [
32
+ "cfg-if",
33
+ ]
34
+
35
+ [[package]]
36
+ name = "derive_arbitrary"
37
+ version = "1.4.2"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a"
40
+ dependencies = [
41
+ "proc-macro2",
42
+ "quote",
43
+ "syn 2.0.119",
44
+ ]
45
+
46
+ [[package]]
47
+ name = "encoding_rs"
48
+ version = "0.8.35"
49
+ source = "registry+https://github.com/rust-lang/crates.io-index"
50
+ checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
51
+ dependencies = [
52
+ "cfg-if",
53
+ ]
54
+
55
+ [[package]]
56
+ name = "equivalent"
57
+ version = "1.0.2"
58
+ source = "registry+https://github.com/rust-lang/crates.io-index"
59
+ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
60
+
61
+ [[package]]
62
+ name = "ezdwf-core"
63
+ version = "0.0.1"
64
+ dependencies = [
65
+ "flate2",
66
+ "indexmap",
67
+ "quick-xml",
68
+ "serde",
69
+ "serde_json",
70
+ "thiserror",
71
+ "ttf-parser",
72
+ "zip",
73
+ ]
74
+
75
+ [[package]]
76
+ name = "ezdwf-python"
77
+ version = "0.0.1"
78
+ dependencies = [
79
+ "ezdwf-core",
80
+ "pyo3",
81
+ ]
82
+
83
+ [[package]]
84
+ name = "flate2"
85
+ version = "1.1.9"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
88
+ dependencies = [
89
+ "miniz_oxide",
90
+ "zlib-rs",
91
+ ]
92
+
93
+ [[package]]
94
+ name = "hashbrown"
95
+ version = "0.16.1"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
98
+
99
+ [[package]]
100
+ name = "heck"
101
+ version = "0.5.0"
102
+ source = "registry+https://github.com/rust-lang/crates.io-index"
103
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
104
+
105
+ [[package]]
106
+ name = "indexmap"
107
+ version = "2.13.0"
108
+ source = "registry+https://github.com/rust-lang/crates.io-index"
109
+ checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
110
+ dependencies = [
111
+ "equivalent",
112
+ "hashbrown",
113
+ ]
114
+
115
+ [[package]]
116
+ name = "itoa"
117
+ version = "1.0.18"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
120
+
121
+ [[package]]
122
+ name = "libc"
123
+ version = "0.2.189"
124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
125
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
126
+
127
+ [[package]]
128
+ name = "memchr"
129
+ version = "2.8.3"
130
+ source = "registry+https://github.com/rust-lang/crates.io-index"
131
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
132
+
133
+ [[package]]
134
+ name = "miniz_oxide"
135
+ version = "0.8.9"
136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
137
+ checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
138
+ dependencies = [
139
+ "adler2",
140
+ "simd-adler32",
141
+ ]
142
+
143
+ [[package]]
144
+ name = "once_cell"
145
+ version = "1.21.4"
146
+ source = "registry+https://github.com/rust-lang/crates.io-index"
147
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
148
+
149
+ [[package]]
150
+ name = "portable-atomic"
151
+ version = "1.14.0"
152
+ source = "registry+https://github.com/rust-lang/crates.io-index"
153
+ checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3"
154
+
155
+ [[package]]
156
+ name = "proc-macro2"
157
+ version = "1.0.107"
158
+ source = "registry+https://github.com/rust-lang/crates.io-index"
159
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
160
+ dependencies = [
161
+ "unicode-ident",
162
+ ]
163
+
164
+ [[package]]
165
+ name = "pyo3"
166
+ version = "0.29.0"
167
+ source = "registry+https://github.com/rust-lang/crates.io-index"
168
+ checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
169
+ dependencies = [
170
+ "libc",
171
+ "once_cell",
172
+ "portable-atomic",
173
+ "pyo3-build-config",
174
+ "pyo3-ffi",
175
+ "pyo3-macros",
176
+ ]
177
+
178
+ [[package]]
179
+ name = "pyo3-build-config"
180
+ version = "0.29.0"
181
+ source = "registry+https://github.com/rust-lang/crates.io-index"
182
+ checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
183
+ dependencies = [
184
+ "target-lexicon",
185
+ ]
186
+
187
+ [[package]]
188
+ name = "pyo3-ffi"
189
+ version = "0.29.0"
190
+ source = "registry+https://github.com/rust-lang/crates.io-index"
191
+ checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
192
+ dependencies = [
193
+ "libc",
194
+ "pyo3-build-config",
195
+ ]
196
+
197
+ [[package]]
198
+ name = "pyo3-macros"
199
+ version = "0.29.0"
200
+ source = "registry+https://github.com/rust-lang/crates.io-index"
201
+ checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
202
+ dependencies = [
203
+ "proc-macro2",
204
+ "pyo3-macros-backend",
205
+ "quote",
206
+ "syn 2.0.119",
207
+ ]
208
+
209
+ [[package]]
210
+ name = "pyo3-macros-backend"
211
+ version = "0.29.0"
212
+ source = "registry+https://github.com/rust-lang/crates.io-index"
213
+ checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
214
+ dependencies = [
215
+ "heck",
216
+ "proc-macro2",
217
+ "quote",
218
+ "syn 2.0.119",
219
+ ]
220
+
221
+ [[package]]
222
+ name = "quick-xml"
223
+ version = "0.41.0"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1"
226
+ dependencies = [
227
+ "encoding_rs",
228
+ "memchr",
229
+ ]
230
+
231
+ [[package]]
232
+ name = "quote"
233
+ version = "1.0.47"
234
+ source = "registry+https://github.com/rust-lang/crates.io-index"
235
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
236
+ dependencies = [
237
+ "proc-macro2",
238
+ ]
239
+
240
+ [[package]]
241
+ name = "serde"
242
+ version = "1.0.229"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
245
+ dependencies = [
246
+ "serde_core",
247
+ "serde_derive",
248
+ ]
249
+
250
+ [[package]]
251
+ name = "serde_core"
252
+ version = "1.0.229"
253
+ source = "registry+https://github.com/rust-lang/crates.io-index"
254
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
255
+ dependencies = [
256
+ "serde_derive",
257
+ ]
258
+
259
+ [[package]]
260
+ name = "serde_derive"
261
+ version = "1.0.229"
262
+ source = "registry+https://github.com/rust-lang/crates.io-index"
263
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
264
+ dependencies = [
265
+ "proc-macro2",
266
+ "quote",
267
+ "syn 3.0.3",
268
+ ]
269
+
270
+ [[package]]
271
+ name = "serde_json"
272
+ version = "1.0.151"
273
+ source = "registry+https://github.com/rust-lang/crates.io-index"
274
+ checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
275
+ dependencies = [
276
+ "itoa",
277
+ "memchr",
278
+ "serde",
279
+ "serde_core",
280
+ "zmij",
281
+ ]
282
+
283
+ [[package]]
284
+ name = "simd-adler32"
285
+ version = "0.3.10"
286
+ source = "registry+https://github.com/rust-lang/crates.io-index"
287
+ checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
288
+
289
+ [[package]]
290
+ name = "syn"
291
+ version = "2.0.119"
292
+ source = "registry+https://github.com/rust-lang/crates.io-index"
293
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
294
+ dependencies = [
295
+ "proc-macro2",
296
+ "quote",
297
+ "unicode-ident",
298
+ ]
299
+
300
+ [[package]]
301
+ name = "syn"
302
+ version = "3.0.3"
303
+ source = "registry+https://github.com/rust-lang/crates.io-index"
304
+ checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
305
+ dependencies = [
306
+ "proc-macro2",
307
+ "quote",
308
+ "unicode-ident",
309
+ ]
310
+
311
+ [[package]]
312
+ name = "target-lexicon"
313
+ version = "0.13.5"
314
+ source = "registry+https://github.com/rust-lang/crates.io-index"
315
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
316
+
317
+ [[package]]
318
+ name = "thiserror"
319
+ version = "2.0.19"
320
+ source = "registry+https://github.com/rust-lang/crates.io-index"
321
+ checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9"
322
+ dependencies = [
323
+ "thiserror-impl",
324
+ ]
325
+
326
+ [[package]]
327
+ name = "thiserror-impl"
328
+ version = "2.0.19"
329
+ source = "registry+https://github.com/rust-lang/crates.io-index"
330
+ checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd"
331
+ dependencies = [
332
+ "proc-macro2",
333
+ "quote",
334
+ "syn 3.0.3",
335
+ ]
336
+
337
+ [[package]]
338
+ name = "ttf-parser"
339
+ version = "0.25.1"
340
+ source = "registry+https://github.com/rust-lang/crates.io-index"
341
+ checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"
342
+
343
+ [[package]]
344
+ name = "unicode-ident"
345
+ version = "1.0.24"
346
+ source = "registry+https://github.com/rust-lang/crates.io-index"
347
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
348
+
349
+ [[package]]
350
+ name = "zip"
351
+ version = "6.0.0"
352
+ source = "registry+https://github.com/rust-lang/crates.io-index"
353
+ checksum = "eb2a05c7c36fde6c09b08576c9f7fb4cda705990f73b58fe011abf7dfb24168b"
354
+ dependencies = [
355
+ "arbitrary",
356
+ "crc32fast",
357
+ "flate2",
358
+ "indexmap",
359
+ "memchr",
360
+ ]
361
+
362
+ [[package]]
363
+ name = "zlib-rs"
364
+ version = "0.6.6"
365
+ source = "registry+https://github.com/rust-lang/crates.io-index"
366
+ checksum = "b142a20ec14a91d5bc708c1dc21b080c550113d8aa77afa29635673a65dd02c5"
367
+
368
+ [[package]]
369
+ name = "zmij"
370
+ version = "1.0.23"
371
+ source = "registry+https://github.com/rust-lang/crates.io-index"
372
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
ezdwf-0.0.1/Cargo.toml ADDED
@@ -0,0 +1,19 @@
1
+ [workspace]
2
+ members = ["crates/ezdwf-core", "crates/ezdwf-python"]
3
+ resolver = "2"
4
+
5
+ [workspace.package]
6
+ version = "0.0.1"
7
+ edition = "2021"
8
+ rust-version = "1.83"
9
+ authors = ["neka-nat <nekanat.stock@gmail.com>"]
10
+ description = "Native DWF 2D package inspector and parser core"
11
+ repository = "https://github.com/monozukuri-ai/ezdwf"
12
+ license = "MIT"
13
+
14
+ [workspace.dependencies]
15
+ indexmap = "=2.13.0"
16
+ pyo3 = { version = "0.29.0", features = ["abi3-py310"] }
17
+ serde = { version = "1.0", features = ["derive", "rc"] }
18
+ thiserror = "2.0.19"
19
+ ttf-parser = "=0.25.1"
ezdwf-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 neka-nat
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ezdwf-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: ezdwf
3
+ Version: 0.0.1
4
+ Classifier: Development Status :: 2 - Pre-Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Programming Language :: Rust
15
+ Classifier: Topic :: Software Development :: Libraries
16
+ Requires-Dist: maturin>=1.13,<2.0 ; extra == 'dev'
17
+ Requires-Dist: pytest>=8.0 ; extra == 'dev'
18
+ Requires-Dist: ruff>=0.16,<0.17 ; extra == 'dev'
19
+ Provides-Extra: dev
20
+ License-File: LICENSE
21
+ Summary: Native DWF 2D package inspector and parser for Python powered by Rust
22
+ Keywords: dwf,cad,autodesk,parser,rust
23
+ Author-email: neka-nat <nekanat.stock@gmail.com>
24
+ License-Expression: MIT
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
27
+ Project-URL: Homepage, https://github.com/monozukuri-ai/ezdwf
28
+ Project-URL: Issues, https://github.com/monozukuri-ai/ezdwf/issues
29
+ Project-URL: Repository, https://github.com/monozukuri-ai/ezdwf
30
+
31
+ # ezdwf
32
+
33
+ `ezdwf` is an experimental, read-only Python library for parsing 2D Autodesk
34
+ DWF and DWFx files. Its parser is written in Rust and exposes drawings through
35
+ an ezdxf-style Python API.
36
+
37
+ The library reads source formats directly without converting them to DXF. It
38
+ provides both a normalized paper-space model for application code and access to
39
+ the underlying DWF, W2D, OPC, and XPS records when lower-level data is needed.
40
+
41
+ ## Installation
42
+
43
+ Python 3.10 or later is required. From a source checkout, run:
44
+
45
+ ```console
46
+ python -m pip install .
47
+ ```
48
+
49
+ Building from source also requires a Rust toolchain.
50
+
51
+ ## Quick start
52
+
53
+ ```python
54
+ import ezdwf
55
+
56
+ drawing = ezdwf.read("drawing.dwf")
57
+ sheet = drawing.modelspace()
58
+
59
+ print(drawing.stats())
60
+
61
+ for entity in sheet.query('LINE POLYLINE[layer=="Walls", visible==true]'):
62
+ print(entity.dxftype(), entity.layer, entity.points)
63
+
64
+ sheet.save_svg("drawing.svg")
65
+ ```
66
+
67
+ Multi-sheet drawings can be accessed by index, page name, or title:
68
+
69
+ ```python
70
+ first_sheet = drawing.sheet(0)
71
+ named_sheet = drawing.sheet("Floor Plan")
72
+ ```
73
+
74
+ ## Command line
75
+
76
+ ```console
77
+ ezdwf inspect drawing.dwf
78
+ ezdwf inspect drawing.dwf --json
79
+ ezdwf render drawing.dwf drawing.svg --sheet 0
80
+ ```
81
+
82
+ Run `ezdwf --help` or `ezdwf <command> --help` for all options.
83
+
84
+ ## Supported input
85
+
86
+ - Legacy 2D DWF/WHIP streams
87
+ - DWF 6 packages containing ePlot/W2D resources
88
+ - DWFx packages containing OPC/OpenXPS fixed pages
89
+
90
+ Common 2D geometry, layers, colors, line and fill styles, text, raster images,
91
+ clips, opacity masks, gradients, Canvas groups, and VisualBrush resources are
92
+ represented in the normalized model. DWFx package fonts can be decoded into
93
+ positioned glyph outlines. Drawings can be queried by entity type and style and
94
+ rendered to deterministic SVG without additional runtime dependencies.
95
+
96
+ For package inspection without normalization, use the lower-level API:
97
+
98
+ ```python
99
+ package = ezdwf.inspect_package("drawing.dwf")
100
+ dwfx = ezdwf.inspect_dwfx("drawing.dwfx")
101
+
102
+ # Glyph outlines are opt-in for structure-only DWFx inspection.
103
+ dwfx_with_outlines = ezdwf.inspect_dwfx(
104
+ "drawing.dwfx",
105
+ resolve_glyph_outlines=True,
106
+ )
107
+ ```
108
+
109
+ ## Coordinates
110
+
111
+ High-level entities use the sheet's paper units in a bottom-left, Y-up
112
+ coordinate system. DWFx pages use device-independent pixels (DIP), where
113
+ 96 DIP equals one inch. Raw objects retain their source coordinate systems and
114
+ transforms.
115
+
116
+ See [the object model documentation](docs/object-model.ja.md) for details.
117
+
118
+ ## Limitations
119
+
120
+ - The API is read-only and is still pre-alpha.
121
+ - Support is focused on 2D ePlot content; 3D DWF content is outside the current
122
+ scope.
123
+ - SVG output is a reference preview. Some color-profile brushes, JPEG XR image
124
+ details, and format-specific embedded fonts cannot yet be rendered exactly.
125
+ - Unsupported or ambiguous source semantics are reported through diagnostics
126
+ instead of being silently approximated.
127
+
128
+ ## License
129
+
130
+ This project is licensed under the [MIT License](LICENSE).
131
+
ezdwf-0.0.1/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # ezdwf
2
+
3
+ `ezdwf` is an experimental, read-only Python library for parsing 2D Autodesk
4
+ DWF and DWFx files. Its parser is written in Rust and exposes drawings through
5
+ an ezdxf-style Python API.
6
+
7
+ The library reads source formats directly without converting them to DXF. It
8
+ provides both a normalized paper-space model for application code and access to
9
+ the underlying DWF, W2D, OPC, and XPS records when lower-level data is needed.
10
+
11
+ ## Installation
12
+
13
+ Python 3.10 or later is required. From a source checkout, run:
14
+
15
+ ```console
16
+ python -m pip install .
17
+ ```
18
+
19
+ Building from source also requires a Rust toolchain.
20
+
21
+ ## Quick start
22
+
23
+ ```python
24
+ import ezdwf
25
+
26
+ drawing = ezdwf.read("drawing.dwf")
27
+ sheet = drawing.modelspace()
28
+
29
+ print(drawing.stats())
30
+
31
+ for entity in sheet.query('LINE POLYLINE[layer=="Walls", visible==true]'):
32
+ print(entity.dxftype(), entity.layer, entity.points)
33
+
34
+ sheet.save_svg("drawing.svg")
35
+ ```
36
+
37
+ Multi-sheet drawings can be accessed by index, page name, or title:
38
+
39
+ ```python
40
+ first_sheet = drawing.sheet(0)
41
+ named_sheet = drawing.sheet("Floor Plan")
42
+ ```
43
+
44
+ ## Command line
45
+
46
+ ```console
47
+ ezdwf inspect drawing.dwf
48
+ ezdwf inspect drawing.dwf --json
49
+ ezdwf render drawing.dwf drawing.svg --sheet 0
50
+ ```
51
+
52
+ Run `ezdwf --help` or `ezdwf <command> --help` for all options.
53
+
54
+ ## Supported input
55
+
56
+ - Legacy 2D DWF/WHIP streams
57
+ - DWF 6 packages containing ePlot/W2D resources
58
+ - DWFx packages containing OPC/OpenXPS fixed pages
59
+
60
+ Common 2D geometry, layers, colors, line and fill styles, text, raster images,
61
+ clips, opacity masks, gradients, Canvas groups, and VisualBrush resources are
62
+ represented in the normalized model. DWFx package fonts can be decoded into
63
+ positioned glyph outlines. Drawings can be queried by entity type and style and
64
+ rendered to deterministic SVG without additional runtime dependencies.
65
+
66
+ For package inspection without normalization, use the lower-level API:
67
+
68
+ ```python
69
+ package = ezdwf.inspect_package("drawing.dwf")
70
+ dwfx = ezdwf.inspect_dwfx("drawing.dwfx")
71
+
72
+ # Glyph outlines are opt-in for structure-only DWFx inspection.
73
+ dwfx_with_outlines = ezdwf.inspect_dwfx(
74
+ "drawing.dwfx",
75
+ resolve_glyph_outlines=True,
76
+ )
77
+ ```
78
+
79
+ ## Coordinates
80
+
81
+ High-level entities use the sheet's paper units in a bottom-left, Y-up
82
+ coordinate system. DWFx pages use device-independent pixels (DIP), where
83
+ 96 DIP equals one inch. Raw objects retain their source coordinate systems and
84
+ transforms.
85
+
86
+ See [the object model documentation](docs/object-model.ja.md) for details.
87
+
88
+ ## Limitations
89
+
90
+ - The API is read-only and is still pre-alpha.
91
+ - Support is focused on 2D ePlot content; 3D DWF content is outside the current
92
+ scope.
93
+ - SVG output is a reference preview. Some color-profile brushes, JPEG XR image
94
+ details, and format-specific embedded fonts cannot yet be rendered exactly.
95
+ - Unsupported or ambiguous source semantics are reported through diagnostics
96
+ instead of being silently approximated.
97
+
98
+ ## License
99
+
100
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,26 @@
1
+ [package]
2
+ name = "ezdwf-core"
3
+ version.workspace = true
4
+ edition.workspace = true
5
+ rust-version.workspace = true
6
+ authors.workspace = true
7
+ description.workspace = true
8
+ repository.workspace = true
9
+ license.workspace = true
10
+
11
+ [lib]
12
+ name = "ezdwf_core"
13
+
14
+ [dependencies]
15
+ flate2 = { version = "1.1.9", default-features = false, features = ["zlib-rs"] }
16
+ # Keep `zip`'s broad indexmap 2.x dependency on an edition-2021 release so
17
+ # Cargo 1.83 can read the complete dependency graph.
18
+ indexmap.workspace = true
19
+ quick-xml = { version = "0.41.0", features = ["encoding"] }
20
+ serde.workspace = true
21
+ thiserror.workspace = true
22
+ ttf-parser.workspace = true
23
+ zip = { version = "=6.0.0", default-features = false, features = ["deflate-flate2-zlib-rs"] }
24
+
25
+ [dev-dependencies]
26
+ serde_json = "1.0"