ezceq 0.1.0__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 (37) hide show
  1. ezceq-0.1.0/Cargo.lock +297 -0
  2. ezceq-0.1.0/Cargo.toml +10 -0
  3. ezceq-0.1.0/LICENSE +21 -0
  4. ezceq-0.1.0/PKG-INFO +79 -0
  5. ezceq-0.1.0/README.md +65 -0
  6. ezceq-0.1.0/THIRD_PARTY_NOTICES.txt +649 -0
  7. ezceq-0.1.0/crates/ezceq-core/Cargo.toml +18 -0
  8. ezceq-0.1.0/crates/ezceq-core/LICENSE +21 -0
  9. ezceq-0.1.0/crates/ezceq-core/README.md +15 -0
  10. ezceq-0.1.0/crates/ezceq-core/src/encoding.rs +50 -0
  11. ezceq-0.1.0/crates/ezceq-core/src/header.rs +134 -0
  12. ezceq-0.1.0/crates/ezceq-core/src/lib.rs +27 -0
  13. ezceq-0.1.0/crates/ezceq-core/src/reader.rs +368 -0
  14. ezceq-0.1.0/crates/ezceq-core/src/topology.rs +402 -0
  15. ezceq-0.1.0/crates/ezceq-core/src/v7/mod.rs +458 -0
  16. ezceq-0.1.0/crates/ezceq-core/src/v7/model.rs +169 -0
  17. ezceq-0.1.0/crates/ezceq-core/src/v7/named.rs +243 -0
  18. ezceq-0.1.0/crates/ezceq-core/tests/attributes.rs +428 -0
  19. ezceq-0.1.0/crates/ezceq-core/tests/records.rs +191 -0
  20. ezceq-0.1.0/crates/ezceq-core/tests/topology.rs +226 -0
  21. ezceq-0.1.0/crates/ezceq-python/Cargo.toml +18 -0
  22. ezceq-0.1.0/crates/ezceq-python/src/lib.rs +67 -0
  23. ezceq-0.1.0/docs/usage-ja.md +29 -0
  24. ezceq-0.1.0/pyproject.toml +38 -0
  25. ezceq-0.1.0/samples/synthetic/fittings-v7.ceq +77 -0
  26. ezceq-0.1.0/samples/synthetic/fittings-v7.expected.json +32 -0
  27. ezceq-0.1.0/samples/synthetic/mixed-v7.ceq +153 -0
  28. ezceq-0.1.0/samples/synthetic/mixed-v7.dxf +1516 -0
  29. ezceq-0.1.0/samples/synthetic/mixed-v7.expected.json +87 -0
  30. ezceq-0.1.0/src/ezceq/__init__.py +26 -0
  31. ezceq-0.1.0/src/ezceq/_core.pyi +14 -0
  32. ezceq-0.1.0/src/ezceq/_geometry.py +75 -0
  33. ezceq-0.1.0/src/ezceq/cli.py +49 -0
  34. ezceq-0.1.0/src/ezceq/dxf.py +190 -0
  35. ezceq-0.1.0/src/ezceq/py.typed +0 -0
  36. ezceq-0.1.0/tests/python/test_dxf.py +197 -0
  37. ezceq-0.1.0/tests/python/test_reader.py +242 -0
ezceq-0.1.0/Cargo.lock ADDED
@@ -0,0 +1,297 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "cfg-if"
7
+ version = "1.0.5"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
10
+
11
+ [[package]]
12
+ name = "core_detect"
13
+ version = "1.0.0"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48"
16
+
17
+ [[package]]
18
+ name = "encoding_rs"
19
+ version = "0.8.44"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5"
22
+ dependencies = [
23
+ "cfg-if",
24
+ "core_detect",
25
+ "multiversion_no_op",
26
+ "rustversion",
27
+ "scopeguard",
28
+ "simdutf8",
29
+ ]
30
+
31
+ [[package]]
32
+ name = "ezceq-core"
33
+ version = "0.1.0"
34
+ dependencies = [
35
+ "encoding_rs",
36
+ "serde",
37
+ "serde_json",
38
+ "thiserror",
39
+ ]
40
+
41
+ [[package]]
42
+ name = "ezceq-python"
43
+ version = "0.1.0"
44
+ dependencies = [
45
+ "ezceq-core",
46
+ "pyo3",
47
+ "pythonize",
48
+ "serde_json",
49
+ ]
50
+
51
+ [[package]]
52
+ name = "heck"
53
+ version = "0.5.0"
54
+ source = "registry+https://github.com/rust-lang/crates.io-index"
55
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
56
+
57
+ [[package]]
58
+ name = "itoa"
59
+ version = "1.0.19"
60
+ source = "registry+https://github.com/rust-lang/crates.io-index"
61
+ checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
62
+
63
+ [[package]]
64
+ name = "libc"
65
+ version = "0.2.191"
66
+ source = "registry+https://github.com/rust-lang/crates.io-index"
67
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
68
+
69
+ [[package]]
70
+ name = "memchr"
71
+ version = "2.8.3"
72
+ source = "registry+https://github.com/rust-lang/crates.io-index"
73
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
74
+
75
+ [[package]]
76
+ name = "multiversion_no_op"
77
+ version = "1.0.0"
78
+ source = "registry+https://github.com/rust-lang/crates.io-index"
79
+ checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d"
80
+
81
+ [[package]]
82
+ name = "once_cell"
83
+ version = "1.21.4"
84
+ source = "registry+https://github.com/rust-lang/crates.io-index"
85
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
86
+
87
+ [[package]]
88
+ name = "portable-atomic"
89
+ version = "1.15.0"
90
+ source = "registry+https://github.com/rust-lang/crates.io-index"
91
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
92
+
93
+ [[package]]
94
+ name = "proc-macro2"
95
+ version = "1.0.107"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
98
+ dependencies = [
99
+ "unicode-ident",
100
+ ]
101
+
102
+ [[package]]
103
+ name = "pyo3"
104
+ version = "0.29.3"
105
+ source = "registry+https://github.com/rust-lang/crates.io-index"
106
+ checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
107
+ dependencies = [
108
+ "libc",
109
+ "once_cell",
110
+ "portable-atomic",
111
+ "pyo3-build-config",
112
+ "pyo3-ffi",
113
+ "pyo3-macros",
114
+ ]
115
+
116
+ [[package]]
117
+ name = "pyo3-build-config"
118
+ version = "0.29.3"
119
+ source = "registry+https://github.com/rust-lang/crates.io-index"
120
+ checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
121
+ dependencies = [
122
+ "target-lexicon",
123
+ ]
124
+
125
+ [[package]]
126
+ name = "pyo3-ffi"
127
+ version = "0.29.3"
128
+ source = "registry+https://github.com/rust-lang/crates.io-index"
129
+ checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
130
+ dependencies = [
131
+ "libc",
132
+ "pyo3-build-config",
133
+ ]
134
+
135
+ [[package]]
136
+ name = "pyo3-macros"
137
+ version = "0.29.3"
138
+ source = "registry+https://github.com/rust-lang/crates.io-index"
139
+ checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
140
+ dependencies = [
141
+ "proc-macro2",
142
+ "pyo3-macros-backend",
143
+ "quote",
144
+ "syn 2.0.119",
145
+ ]
146
+
147
+ [[package]]
148
+ name = "pyo3-macros-backend"
149
+ version = "0.29.3"
150
+ source = "registry+https://github.com/rust-lang/crates.io-index"
151
+ checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
152
+ dependencies = [
153
+ "heck",
154
+ "proc-macro2",
155
+ "quote",
156
+ "syn 2.0.119",
157
+ ]
158
+
159
+ [[package]]
160
+ name = "pythonize"
161
+ version = "0.29.0"
162
+ source = "registry+https://github.com/rust-lang/crates.io-index"
163
+ checksum = "6ec376e1216e0c929a74964ce2020012a1a39f32d80e78aa688721219ea7fb89"
164
+ dependencies = [
165
+ "pyo3",
166
+ "serde",
167
+ ]
168
+
169
+ [[package]]
170
+ name = "quote"
171
+ version = "1.0.47"
172
+ source = "registry+https://github.com/rust-lang/crates.io-index"
173
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
174
+ dependencies = [
175
+ "proc-macro2",
176
+ ]
177
+
178
+ [[package]]
179
+ name = "rustversion"
180
+ version = "1.0.23"
181
+ source = "registry+https://github.com/rust-lang/crates.io-index"
182
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
183
+
184
+ [[package]]
185
+ name = "scopeguard"
186
+ version = "1.2.0"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
189
+
190
+ [[package]]
191
+ name = "serde"
192
+ version = "1.0.229"
193
+ source = "registry+https://github.com/rust-lang/crates.io-index"
194
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
195
+ dependencies = [
196
+ "serde_core",
197
+ "serde_derive",
198
+ ]
199
+
200
+ [[package]]
201
+ name = "serde_core"
202
+ version = "1.0.229"
203
+ source = "registry+https://github.com/rust-lang/crates.io-index"
204
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
205
+ dependencies = [
206
+ "serde_derive",
207
+ ]
208
+
209
+ [[package]]
210
+ name = "serde_derive"
211
+ version = "1.0.229"
212
+ source = "registry+https://github.com/rust-lang/crates.io-index"
213
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
214
+ dependencies = [
215
+ "proc-macro2",
216
+ "quote",
217
+ "syn 3.0.10",
218
+ ]
219
+
220
+ [[package]]
221
+ name = "serde_json"
222
+ version = "1.0.154"
223
+ source = "registry+https://github.com/rust-lang/crates.io-index"
224
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
225
+ dependencies = [
226
+ "itoa",
227
+ "memchr",
228
+ "serde",
229
+ "serde_core",
230
+ "zmij",
231
+ ]
232
+
233
+ [[package]]
234
+ name = "simdutf8"
235
+ version = "0.1.5"
236
+ source = "registry+https://github.com/rust-lang/crates.io-index"
237
+ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
238
+
239
+ [[package]]
240
+ name = "syn"
241
+ version = "2.0.119"
242
+ source = "registry+https://github.com/rust-lang/crates.io-index"
243
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
244
+ dependencies = [
245
+ "proc-macro2",
246
+ "quote",
247
+ "unicode-ident",
248
+ ]
249
+
250
+ [[package]]
251
+ name = "syn"
252
+ version = "3.0.10"
253
+ source = "registry+https://github.com/rust-lang/crates.io-index"
254
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
255
+ dependencies = [
256
+ "proc-macro2",
257
+ "quote",
258
+ "unicode-ident",
259
+ ]
260
+
261
+ [[package]]
262
+ name = "target-lexicon"
263
+ version = "0.13.6"
264
+ source = "registry+https://github.com/rust-lang/crates.io-index"
265
+ checksum = "8c447be3a2abfa84b2d91680c56600bd6b2873866de27b36ec911be705e291da"
266
+
267
+ [[package]]
268
+ name = "thiserror"
269
+ version = "2.0.21"
270
+ source = "registry+https://github.com/rust-lang/crates.io-index"
271
+ checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
272
+ dependencies = [
273
+ "thiserror-impl",
274
+ ]
275
+
276
+ [[package]]
277
+ name = "thiserror-impl"
278
+ version = "2.0.21"
279
+ source = "registry+https://github.com/rust-lang/crates.io-index"
280
+ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
281
+ dependencies = [
282
+ "proc-macro2",
283
+ "quote",
284
+ "syn 3.0.10",
285
+ ]
286
+
287
+ [[package]]
288
+ name = "unicode-ident"
289
+ version = "1.0.27"
290
+ source = "registry+https://github.com/rust-lang/crates.io-index"
291
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
292
+
293
+ [[package]]
294
+ name = "zmij"
295
+ version = "1.0.23"
296
+ source = "registry+https://github.com/rust-lang/crates.io-index"
297
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
ezceq-0.1.0/Cargo.toml ADDED
@@ -0,0 +1,10 @@
1
+ [workspace]
2
+ members = ["crates/ezceq-core", "crates/ezceq-python"]
3
+ resolver = "2"
4
+
5
+ [workspace.package]
6
+ version = "0.1.0"
7
+ edition = "2021"
8
+ license = "MIT"
9
+ repository = "https://github.com/monozukuri-ai/ezceq"
10
+
ezceq-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 monozukuri-ai
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.
ezceq-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: ezceq
3
+ Version: 0.1.0
4
+ Requires-Dist: cad2d-ir>=0.19.2,<0.20 ; extra == 'dxf'
5
+ Provides-Extra: dxf
6
+ License-File: LICENSE
7
+ License-File: THIRD_PARTY_NOTICES.txt
8
+ Summary: BE-Bridge Ver.7.0 CEQ record reader with a Rust core
9
+ License-Expression: MIT
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
12
+ Project-URL: Repository, https://github.com/monozukuri-ai/ezceq
13
+
14
+ # ezceq
15
+
16
+ Read BE-Bridge 7.0 CEQ files from building-services CAD software. The Rust parser exposes pipe and duct dimensions, system names, port coordinates, and connections through a Python API and a JSON command-line tool. A companion DXF can link a selected drawing entity back to its CEQ component. [日本語ガイド](https://github.com/monozukuri-ai/ezceq/blob/main/docs/usage-ja.md)
17
+
18
+ ## Install from source
19
+
20
+ Use Python 3.10 or later and a Rust toolchain. From the repository root, install the package in a virtual environment.
21
+
22
+ ```sh
23
+ python -m pip install .
24
+ ezceq samples/synthetic/mixed-v7.ceq --encoding cp932
25
+ ```
26
+
27
+ The CLI writes UTF-8 JSON. The input encoding is explicit and accepts `cp932` or `utf-8`. The example has two pipes, two ducts, and one resolved connection between port 2 of pipe `P00001` and port 1 of reducer `P00009`. [Sample drawing and expected values](https://github.com/monozukuri-ai/ezceq/tree/main/samples/synthetic/)
28
+
29
+ ## Python
30
+
31
+ ```python
32
+ import ezceq
33
+
34
+ doc = ezceq.readfile("samples/synthetic/mixed-v7.ceq", encoding="cp932")
35
+ data = doc.to_dict()
36
+ reducer = next(p for p in data["parts"] if p["id"] == "P00009")
37
+ print(reducer["system"], reducer["nominal_by_port"]) # 冷水送り [50.0, 25.0]
38
+ print(data["connections"]) # [{'a': ['P00001', 2], 'b': ['P00009', 1]}]
39
+ raw = doc.raw_record(reducer["line"])
40
+ ```
41
+
42
+ Use `ezceq.read_ceq(data, encoding=...)` for a byte buffer and `doc.to_json()` for serialized output. Rust callers can use `ezceq_core::read_ceq` with `ReadOptions` and `TextEncoding`. [Rust API](https://github.com/monozukuri-ai/ezceq/blob/main/crates/ezceq-core/src/lib.rs)
43
+
44
+ | Output | Meaning |
45
+ |---|---|
46
+ | `parts` | Records in file order. Supported pipe and duct families include straight sections, elbows, tees and reducers. Each parsed port distinguishes an unused slot, an open end and a reference to another part. |
47
+ | `connections` | Undirected pairs of ports. Resolution requires unique part IDs, reciprocal references and equal XYZ coordinates as decimal values. Unresolved references retain their source locations in `diagnostics`. |
48
+ | `actual_counts`, `unsupported_counts` | Observed counts by component type and unsupported counts by reason. Each record retains its identifier, starting line and original byte range. |
49
+ | `diagnostics`, `unparsed_range` | Problems found during reading and any remaining bytes after a record boundary was lost. Lines start at 1. Byte ranges are zero-based with an exclusive end. |
50
+
51
+ The CLI exits with `0` on success (including warnings), `1` on a fatal input or file error, and `2` when it writes a partial result with CEQ data errors. Python raises `InvalidHeaderError` or `UnsupportedVersionError` for invalid headers and unsupported versions. For a parsed document, check `doc.has_errors`.
52
+
53
+ ## Select a component in a DXF
54
+
55
+ ```sh
56
+ python -m pip install '.[dxf]'
57
+ ezceq samples/synthetic/mixed-v7.ceq --encoding cp932 --dxf
58
+ ```
59
+
60
+ `--dxf` discovers a same-name companion. Use `--dxf PATH` to select a specific file. The added `dxf` object records which INSERT instances match each complete CEQ block name. It distinguishes multiple placements, unplaced definitions, missing definitions, ambiguous records and a missing companion.
61
+
62
+ ```python
63
+ from ezceq.dxf import link_dxf, part_indices_for_entity
64
+
65
+ links = link_dxf(data, "samples/synthetic/mixed-v7.dxf")
66
+ indices = part_indices_for_entity(links, "E49/E45") # outline of the rectangular duct
67
+ print([data["parts"][i]["id"] for i in indices]) # ['D00025']
68
+ ```
69
+
70
+ If a viewer already holds the DXF-derived cad2d-ir document, pass it to `link_ir(data, ir_document)`. Keep the parent INSERT IDs when expanding blocks. The placement path identifies a particular instance of a shared definition.
71
+
72
+ ## Format reference
73
+
74
+ The reader implements the BE-Bridge 7.0 exchange specification by C-CADEC. The examples in this repository are hand-authored. [BE-Bridge 7.0 specification, archived C-CADEC publication (Japanese PDF)](https://web.archive.org/web/20240326020558id_/https://www.kensetsu-kikin.or.jp/archive/c-cadec/hyogikai/data/be_bridge7.pdf)
75
+
76
+ ## License
77
+
78
+ ezceq and its hand-authored samples are available under the MIT License. Copyright © 2026 monozukuri-ai. [License](https://github.com/monozukuri-ai/ezceq/blob/main/LICENSE) · [Third-party notices](https://github.com/monozukuri-ai/ezceq/blob/main/THIRD_PARTY_NOTICES.txt)
79
+
ezceq-0.1.0/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # ezceq
2
+
3
+ Read BE-Bridge 7.0 CEQ files from building-services CAD software. The Rust parser exposes pipe and duct dimensions, system names, port coordinates, and connections through a Python API and a JSON command-line tool. A companion DXF can link a selected drawing entity back to its CEQ component. [日本語ガイド](https://github.com/monozukuri-ai/ezceq/blob/main/docs/usage-ja.md)
4
+
5
+ ## Install from source
6
+
7
+ Use Python 3.10 or later and a Rust toolchain. From the repository root, install the package in a virtual environment.
8
+
9
+ ```sh
10
+ python -m pip install .
11
+ ezceq samples/synthetic/mixed-v7.ceq --encoding cp932
12
+ ```
13
+
14
+ The CLI writes UTF-8 JSON. The input encoding is explicit and accepts `cp932` or `utf-8`. The example has two pipes, two ducts, and one resolved connection between port 2 of pipe `P00001` and port 1 of reducer `P00009`. [Sample drawing and expected values](https://github.com/monozukuri-ai/ezceq/tree/main/samples/synthetic/)
15
+
16
+ ## Python
17
+
18
+ ```python
19
+ import ezceq
20
+
21
+ doc = ezceq.readfile("samples/synthetic/mixed-v7.ceq", encoding="cp932")
22
+ data = doc.to_dict()
23
+ reducer = next(p for p in data["parts"] if p["id"] == "P00009")
24
+ print(reducer["system"], reducer["nominal_by_port"]) # 冷水送り [50.0, 25.0]
25
+ print(data["connections"]) # [{'a': ['P00001', 2], 'b': ['P00009', 1]}]
26
+ raw = doc.raw_record(reducer["line"])
27
+ ```
28
+
29
+ Use `ezceq.read_ceq(data, encoding=...)` for a byte buffer and `doc.to_json()` for serialized output. Rust callers can use `ezceq_core::read_ceq` with `ReadOptions` and `TextEncoding`. [Rust API](https://github.com/monozukuri-ai/ezceq/blob/main/crates/ezceq-core/src/lib.rs)
30
+
31
+ | Output | Meaning |
32
+ |---|---|
33
+ | `parts` | Records in file order. Supported pipe and duct families include straight sections, elbows, tees and reducers. Each parsed port distinguishes an unused slot, an open end and a reference to another part. |
34
+ | `connections` | Undirected pairs of ports. Resolution requires unique part IDs, reciprocal references and equal XYZ coordinates as decimal values. Unresolved references retain their source locations in `diagnostics`. |
35
+ | `actual_counts`, `unsupported_counts` | Observed counts by component type and unsupported counts by reason. Each record retains its identifier, starting line and original byte range. |
36
+ | `diagnostics`, `unparsed_range` | Problems found during reading and any remaining bytes after a record boundary was lost. Lines start at 1. Byte ranges are zero-based with an exclusive end. |
37
+
38
+ The CLI exits with `0` on success (including warnings), `1` on a fatal input or file error, and `2` when it writes a partial result with CEQ data errors. Python raises `InvalidHeaderError` or `UnsupportedVersionError` for invalid headers and unsupported versions. For a parsed document, check `doc.has_errors`.
39
+
40
+ ## Select a component in a DXF
41
+
42
+ ```sh
43
+ python -m pip install '.[dxf]'
44
+ ezceq samples/synthetic/mixed-v7.ceq --encoding cp932 --dxf
45
+ ```
46
+
47
+ `--dxf` discovers a same-name companion. Use `--dxf PATH` to select a specific file. The added `dxf` object records which INSERT instances match each complete CEQ block name. It distinguishes multiple placements, unplaced definitions, missing definitions, ambiguous records and a missing companion.
48
+
49
+ ```python
50
+ from ezceq.dxf import link_dxf, part_indices_for_entity
51
+
52
+ links = link_dxf(data, "samples/synthetic/mixed-v7.dxf")
53
+ indices = part_indices_for_entity(links, "E49/E45") # outline of the rectangular duct
54
+ print([data["parts"][i]["id"] for i in indices]) # ['D00025']
55
+ ```
56
+
57
+ If a viewer already holds the DXF-derived cad2d-ir document, pass it to `link_ir(data, ir_document)`. Keep the parent INSERT IDs when expanding blocks. The placement path identifies a particular instance of a shared definition.
58
+
59
+ ## Format reference
60
+
61
+ The reader implements the BE-Bridge 7.0 exchange specification by C-CADEC. The examples in this repository are hand-authored. [BE-Bridge 7.0 specification, archived C-CADEC publication (Japanese PDF)](https://web.archive.org/web/20240326020558id_/https://www.kensetsu-kikin.or.jp/archive/c-cadec/hyogikai/data/be_bridge7.pdf)
62
+
63
+ ## License
64
+
65
+ ezceq and its hand-authored samples are available under the MIT License. Copyright © 2026 monozukuri-ai. [License](https://github.com/monozukuri-ai/ezceq/blob/main/LICENSE) · [Third-party notices](https://github.com/monozukuri-ai/ezceq/blob/main/THIRD_PARTY_NOTICES.txt)