polyxml 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.
@@ -0,0 +1,522 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.5"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
19
+
20
+ [[package]]
21
+ name = "bitflags"
22
+ version = "2.13.1"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
25
+
26
+ [[package]]
27
+ name = "cfg-if"
28
+ version = "1.0.4"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
31
+
32
+ [[package]]
33
+ name = "convert_case"
34
+ version = "0.6.0"
35
+ source = "registry+https://github.com/rust-lang/crates.io-index"
36
+ checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca"
37
+ dependencies = [
38
+ "unicode-segmentation",
39
+ ]
40
+
41
+ [[package]]
42
+ name = "ctor"
43
+ version = "0.2.9"
44
+ source = "registry+https://github.com/rust-lang/crates.io-index"
45
+ checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501"
46
+ dependencies = [
47
+ "quote",
48
+ "syn 2.0.119",
49
+ ]
50
+
51
+ [[package]]
52
+ name = "diff"
53
+ version = "0.1.13"
54
+ source = "registry+https://github.com/rust-lang/crates.io-index"
55
+ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
56
+
57
+ [[package]]
58
+ name = "heck"
59
+ version = "0.5.0"
60
+ source = "registry+https://github.com/rust-lang/crates.io-index"
61
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
62
+
63
+ [[package]]
64
+ name = "indoc"
65
+ version = "2.0.7"
66
+ source = "registry+https://github.com/rust-lang/crates.io-index"
67
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
68
+ dependencies = [
69
+ "rustversion",
70
+ ]
71
+
72
+ [[package]]
73
+ name = "lexical-core"
74
+ version = "1.0.6"
75
+ source = "registry+https://github.com/rust-lang/crates.io-index"
76
+ checksum = "7d8d125a277f807e55a77304455eb7b1cb52f2b18c143b60e766c120bd64a594"
77
+ dependencies = [
78
+ "lexical-parse-float",
79
+ "lexical-parse-integer",
80
+ "lexical-util",
81
+ "lexical-write-float",
82
+ "lexical-write-integer",
83
+ ]
84
+
85
+ [[package]]
86
+ name = "lexical-parse-float"
87
+ version = "1.0.6"
88
+ source = "registry+https://github.com/rust-lang/crates.io-index"
89
+ checksum = "52a9f232fbd6f550bc0137dcb5f99ab674071ac2d690ac69704593cb4abbea56"
90
+ dependencies = [
91
+ "lexical-parse-integer",
92
+ "lexical-util",
93
+ ]
94
+
95
+ [[package]]
96
+ name = "lexical-parse-integer"
97
+ version = "1.0.6"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "9a7a039f8fb9c19c996cd7b2fcce303c1b2874fe1aca544edc85c4a5f8489b34"
100
+ dependencies = [
101
+ "lexical-util",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "lexical-util"
106
+ version = "1.0.7"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "2604dd126bb14f13fb5d1bd6a66155079cb9fa655b37f875b3a742c705dbed17"
109
+
110
+ [[package]]
111
+ name = "lexical-write-float"
112
+ version = "1.0.6"
113
+ source = "registry+https://github.com/rust-lang/crates.io-index"
114
+ checksum = "50c438c87c013188d415fbabbb1dceb44249ab81664efbd31b14ae55dabb6361"
115
+ dependencies = [
116
+ "lexical-util",
117
+ "lexical-write-integer",
118
+ ]
119
+
120
+ [[package]]
121
+ name = "lexical-write-integer"
122
+ version = "1.0.6"
123
+ source = "registry+https://github.com/rust-lang/crates.io-index"
124
+ checksum = "409851a618475d2d5796377cad353802345cba92c867d9fbcde9cf4eac4e14df"
125
+ dependencies = [
126
+ "lexical-util",
127
+ ]
128
+
129
+ [[package]]
130
+ name = "libc"
131
+ version = "0.2.189"
132
+ source = "registry+https://github.com/rust-lang/crates.io-index"
133
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
134
+
135
+ [[package]]
136
+ name = "libloading"
137
+ version = "0.8.9"
138
+ source = "registry+https://github.com/rust-lang/crates.io-index"
139
+ checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
140
+ dependencies = [
141
+ "cfg-if",
142
+ "windows-link",
143
+ ]
144
+
145
+ [[package]]
146
+ name = "memchr"
147
+ version = "2.8.3"
148
+ source = "registry+https://github.com/rust-lang/crates.io-index"
149
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
150
+
151
+ [[package]]
152
+ name = "memoffset"
153
+ version = "0.9.1"
154
+ source = "registry+https://github.com/rust-lang/crates.io-index"
155
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
156
+ dependencies = [
157
+ "autocfg",
158
+ ]
159
+
160
+ [[package]]
161
+ name = "napi"
162
+ version = "2.16.17"
163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
164
+ checksum = "55740c4ae1d8696773c78fdafd5d0e5fe9bc9f1b071c7ba493ba5c413a9184f3"
165
+ dependencies = [
166
+ "bitflags",
167
+ "ctor",
168
+ "napi-derive",
169
+ "napi-sys",
170
+ "once_cell",
171
+ ]
172
+
173
+ [[package]]
174
+ name = "napi-build"
175
+ version = "2.4.1"
176
+ source = "registry+https://github.com/rust-lang/crates.io-index"
177
+ checksum = "60fdf9b392c50e7c4170fa633bd909490ed7835cea4c046776d1a4dd8d2ae0ab"
178
+
179
+ [[package]]
180
+ name = "napi-derive"
181
+ version = "2.16.13"
182
+ source = "registry+https://github.com/rust-lang/crates.io-index"
183
+ checksum = "7cbe2585d8ac223f7d34f13701434b9d5f4eb9c332cccce8dee57ea18ab8ab0c"
184
+ dependencies = [
185
+ "cfg-if",
186
+ "convert_case",
187
+ "napi-derive-backend",
188
+ "proc-macro2",
189
+ "quote",
190
+ "syn 2.0.119",
191
+ ]
192
+
193
+ [[package]]
194
+ name = "napi-derive-backend"
195
+ version = "1.0.75"
196
+ source = "registry+https://github.com/rust-lang/crates.io-index"
197
+ checksum = "1639aaa9eeb76e91c6ae66da8ce3e89e921cd3885e99ec85f4abacae72fc91bf"
198
+ dependencies = [
199
+ "convert_case",
200
+ "once_cell",
201
+ "proc-macro2",
202
+ "quote",
203
+ "regex",
204
+ "semver",
205
+ "syn 2.0.119",
206
+ ]
207
+
208
+ [[package]]
209
+ name = "napi-sys"
210
+ version = "2.4.0"
211
+ source = "registry+https://github.com/rust-lang/crates.io-index"
212
+ checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3"
213
+ dependencies = [
214
+ "libloading",
215
+ ]
216
+
217
+ [[package]]
218
+ name = "once_cell"
219
+ version = "1.21.4"
220
+ source = "registry+https://github.com/rust-lang/crates.io-index"
221
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
222
+
223
+ [[package]]
224
+ name = "polyxml"
225
+ version = "0.1.0"
226
+ dependencies = [
227
+ "lexical-core",
228
+ "memchr",
229
+ "pretty_assertions",
230
+ "quick-xml",
231
+ "smallvec",
232
+ "thiserror",
233
+ ]
234
+
235
+ [[package]]
236
+ name = "polyxml-c"
237
+ version = "0.1.0"
238
+ dependencies = [
239
+ "polyxml",
240
+ ]
241
+
242
+ [[package]]
243
+ name = "polyxml-js"
244
+ version = "0.1.0"
245
+ dependencies = [
246
+ "napi",
247
+ "napi-build",
248
+ "napi-derive",
249
+ "polyxml",
250
+ ]
251
+
252
+ [[package]]
253
+ name = "polyxml-python"
254
+ version = "0.1.0"
255
+ dependencies = [
256
+ "lexical-core",
257
+ "polyxml",
258
+ "pyo3",
259
+ "quick-xml",
260
+ "smallvec",
261
+ ]
262
+
263
+ [[package]]
264
+ name = "portable-atomic"
265
+ version = "1.15.0"
266
+ source = "registry+https://github.com/rust-lang/crates.io-index"
267
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
268
+
269
+ [[package]]
270
+ name = "pretty_assertions"
271
+ version = "1.4.1"
272
+ source = "registry+https://github.com/rust-lang/crates.io-index"
273
+ checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d"
274
+ dependencies = [
275
+ "diff",
276
+ "yansi",
277
+ ]
278
+
279
+ [[package]]
280
+ name = "proc-macro2"
281
+ version = "1.0.107"
282
+ source = "registry+https://github.com/rust-lang/crates.io-index"
283
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
284
+ dependencies = [
285
+ "unicode-ident",
286
+ ]
287
+
288
+ [[package]]
289
+ name = "pyo3"
290
+ version = "0.22.6"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884"
293
+ dependencies = [
294
+ "cfg-if",
295
+ "indoc",
296
+ "libc",
297
+ "memoffset",
298
+ "once_cell",
299
+ "portable-atomic",
300
+ "pyo3-build-config",
301
+ "pyo3-ffi",
302
+ "pyo3-macros",
303
+ "unindent",
304
+ ]
305
+
306
+ [[package]]
307
+ name = "pyo3-build-config"
308
+ version = "0.22.6"
309
+ source = "registry+https://github.com/rust-lang/crates.io-index"
310
+ checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38"
311
+ dependencies = [
312
+ "once_cell",
313
+ "target-lexicon",
314
+ ]
315
+
316
+ [[package]]
317
+ name = "pyo3-ffi"
318
+ version = "0.22.6"
319
+ source = "registry+https://github.com/rust-lang/crates.io-index"
320
+ checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636"
321
+ dependencies = [
322
+ "libc",
323
+ "pyo3-build-config",
324
+ ]
325
+
326
+ [[package]]
327
+ name = "pyo3-macros"
328
+ version = "0.22.6"
329
+ source = "registry+https://github.com/rust-lang/crates.io-index"
330
+ checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453"
331
+ dependencies = [
332
+ "proc-macro2",
333
+ "pyo3-macros-backend",
334
+ "quote",
335
+ "syn 2.0.119",
336
+ ]
337
+
338
+ [[package]]
339
+ name = "pyo3-macros-backend"
340
+ version = "0.22.6"
341
+ source = "registry+https://github.com/rust-lang/crates.io-index"
342
+ checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
343
+ dependencies = [
344
+ "heck",
345
+ "proc-macro2",
346
+ "pyo3-build-config",
347
+ "quote",
348
+ "syn 2.0.119",
349
+ ]
350
+
351
+ [[package]]
352
+ name = "quick-xml"
353
+ version = "0.36.2"
354
+ source = "registry+https://github.com/rust-lang/crates.io-index"
355
+ checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe"
356
+ dependencies = [
357
+ "memchr",
358
+ "serde",
359
+ ]
360
+
361
+ [[package]]
362
+ name = "quote"
363
+ version = "1.0.47"
364
+ source = "registry+https://github.com/rust-lang/crates.io-index"
365
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
366
+ dependencies = [
367
+ "proc-macro2",
368
+ ]
369
+
370
+ [[package]]
371
+ name = "regex"
372
+ version = "1.13.1"
373
+ source = "registry+https://github.com/rust-lang/crates.io-index"
374
+ checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
375
+ dependencies = [
376
+ "aho-corasick",
377
+ "memchr",
378
+ "regex-automata",
379
+ "regex-syntax",
380
+ ]
381
+
382
+ [[package]]
383
+ name = "regex-automata"
384
+ version = "0.4.18"
385
+ source = "registry+https://github.com/rust-lang/crates.io-index"
386
+ checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
387
+ dependencies = [
388
+ "aho-corasick",
389
+ "memchr",
390
+ "regex-syntax",
391
+ ]
392
+
393
+ [[package]]
394
+ name = "regex-syntax"
395
+ version = "0.8.11"
396
+ source = "registry+https://github.com/rust-lang/crates.io-index"
397
+ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
398
+
399
+ [[package]]
400
+ name = "rustversion"
401
+ version = "1.0.23"
402
+ source = "registry+https://github.com/rust-lang/crates.io-index"
403
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
404
+
405
+ [[package]]
406
+ name = "semver"
407
+ version = "1.0.28"
408
+ source = "registry+https://github.com/rust-lang/crates.io-index"
409
+ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
410
+
411
+ [[package]]
412
+ name = "serde"
413
+ version = "1.0.229"
414
+ source = "registry+https://github.com/rust-lang/crates.io-index"
415
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
416
+ dependencies = [
417
+ "serde_core",
418
+ ]
419
+
420
+ [[package]]
421
+ name = "serde_core"
422
+ version = "1.0.229"
423
+ source = "registry+https://github.com/rust-lang/crates.io-index"
424
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
425
+ dependencies = [
426
+ "serde_derive",
427
+ ]
428
+
429
+ [[package]]
430
+ name = "serde_derive"
431
+ version = "1.0.229"
432
+ source = "registry+https://github.com/rust-lang/crates.io-index"
433
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
434
+ dependencies = [
435
+ "proc-macro2",
436
+ "quote",
437
+ "syn 3.0.5",
438
+ ]
439
+
440
+ [[package]]
441
+ name = "smallvec"
442
+ version = "1.16.0"
443
+ source = "registry+https://github.com/rust-lang/crates.io-index"
444
+ checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f"
445
+
446
+ [[package]]
447
+ name = "syn"
448
+ version = "2.0.119"
449
+ source = "registry+https://github.com/rust-lang/crates.io-index"
450
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
451
+ dependencies = [
452
+ "proc-macro2",
453
+ "quote",
454
+ "unicode-ident",
455
+ ]
456
+
457
+ [[package]]
458
+ name = "syn"
459
+ version = "3.0.5"
460
+ source = "registry+https://github.com/rust-lang/crates.io-index"
461
+ checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"
462
+ dependencies = [
463
+ "proc-macro2",
464
+ "quote",
465
+ "unicode-ident",
466
+ ]
467
+
468
+ [[package]]
469
+ name = "target-lexicon"
470
+ version = "0.12.16"
471
+ source = "registry+https://github.com/rust-lang/crates.io-index"
472
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
473
+
474
+ [[package]]
475
+ name = "thiserror"
476
+ version = "2.0.20"
477
+ source = "registry+https://github.com/rust-lang/crates.io-index"
478
+ checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
479
+ dependencies = [
480
+ "thiserror-impl",
481
+ ]
482
+
483
+ [[package]]
484
+ name = "thiserror-impl"
485
+ version = "2.0.20"
486
+ source = "registry+https://github.com/rust-lang/crates.io-index"
487
+ checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
488
+ dependencies = [
489
+ "proc-macro2",
490
+ "quote",
491
+ "syn 3.0.5",
492
+ ]
493
+
494
+ [[package]]
495
+ name = "unicode-ident"
496
+ version = "1.0.24"
497
+ source = "registry+https://github.com/rust-lang/crates.io-index"
498
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
499
+
500
+ [[package]]
501
+ name = "unicode-segmentation"
502
+ version = "1.13.3"
503
+ source = "registry+https://github.com/rust-lang/crates.io-index"
504
+ checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
505
+
506
+ [[package]]
507
+ name = "unindent"
508
+ version = "0.2.4"
509
+ source = "registry+https://github.com/rust-lang/crates.io-index"
510
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
511
+
512
+ [[package]]
513
+ name = "windows-link"
514
+ version = "0.2.1"
515
+ source = "registry+https://github.com/rust-lang/crates.io-index"
516
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
517
+
518
+ [[package]]
519
+ name = "yansi"
520
+ version = "1.0.1"
521
+ source = "registry+https://github.com/rust-lang/crates.io-index"
522
+ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
@@ -0,0 +1,21 @@
1
+ [workspace]
2
+ resolver = "2"
3
+ members = ["crates/polyxml-core", "crates/polyxml-python"]
4
+
5
+ [workspace.package]
6
+ version = "0.1.0"
7
+ edition = "2021"
8
+ rust-version = "1.80"
9
+ license = "MIT"
10
+ authors = ["Bailey Nguyen <bailey.tan.nguyen@gmail.com>"]
11
+ repository = "https://github.com/nth-bailey/PolyXML"
12
+ homepage = "https://github.com/nth-bailey/PolyXML"
13
+ keywords = ["xml", "deserializer", "serializer", "data-binding", "polyglot"]
14
+ categories = ["parsing", "encoding"]
15
+
16
+ [profile.release]
17
+ opt-level = 3
18
+ lto = "thin"
19
+ codegen-units = 1
20
+ strip = true
21
+ panic = "abort"
polyxml-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: polyxml
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 4 - Beta
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Programming Language :: Rust
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
12
+ Classifier: Topic :: Text Processing :: Markup :: XML
13
+ Classifier: Typing :: Typed
14
+ Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
15
+ Requires-Dist: pytest-cov>=5.0.0 ; extra == 'dev'
16
+ Requires-Dist: pydantic>=2.7.0 ; extra == 'dev'
17
+ Requires-Dist: ruff>=0.4.0 ; extra == 'dev'
18
+ Provides-Extra: dev
19
+ Summary: High-performance, polyglot XML data-binding engine built in Rust
20
+ Author-email: Bailey Nguyen <bailey.tan.nguyen@gmail.com>
21
+ License: MIT
22
+ Requires-Python: >=3.12
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+ Project-URL: Documentation, https://nth-bailey.github.io/PolyXML/
25
+ Project-URL: Homepage, https://github.com/nth-bailey/PolyXML
26
+ Project-URL: Issues, https://github.com/nth-bailey/PolyXML/issues
27
+ Project-URL: Repository, https://github.com/nth-bailey/PolyXML
28
+
29
+ # PolyXML Python Bindings
30
+
31
+ High-performance native XML data-binding engine for Python dataclasses and Pydantic models.
32
+
33
+ Powered by polyxml-core written in Rust and PyO3 (abi3-py312).
34
+
@@ -0,0 +1,5 @@
1
+ # PolyXML Python Bindings
2
+
3
+ High-performance native XML data-binding engine for Python dataclasses and Pydantic models.
4
+
5
+ Powered by polyxml-core written in Rust and PyO3 (abi3-py312).
@@ -0,0 +1,20 @@
1
+ [package]
2
+ name = "polyxml"
3
+ version.workspace = true
4
+ edition.workspace = true
5
+ license.workspace = true
6
+ authors.workspace = true
7
+ repository.workspace = true
8
+ description = "Pure Rust high-performance streaming XML data-binding core engine"
9
+ keywords = ["xml", "deserializer", "serializer", "data-binding", "quick-xml"]
10
+ categories = ["parsing", "encoding"]
11
+
12
+ [dependencies]
13
+ quick-xml = { version = "0.36", features = ["serialize"] }
14
+ lexical-core = "1.0"
15
+ memchr = "2.8"
16
+ thiserror = "2.0"
17
+ smallvec = "1.16"
18
+
19
+ [dev-dependencies]
20
+ pretty_assertions = "1.4"
@@ -0,0 +1,80 @@
1
+ use crate::error::{PolyXmlError, Result};
2
+ use crate::schema::ScalarType;
3
+ use crate::value::PolyValue;
4
+
5
+ #[inline(always)]
6
+ pub fn trim_bytes(mut b: &[u8]) -> &[u8] {
7
+ while let Some((first, rest)) = b.split_first() {
8
+ if first.is_ascii_whitespace() {
9
+ b = rest;
10
+ } else {
11
+ break;
12
+ }
13
+ }
14
+ while let Some((last, rest)) = b.split_last() {
15
+ if last.is_ascii_whitespace() {
16
+ b = rest;
17
+ } else {
18
+ break;
19
+ }
20
+ }
21
+ b
22
+ }
23
+
24
+ pub struct ValueConverter;
25
+
26
+ impl ValueConverter {
27
+ pub fn parse_scalar(
28
+ scalar_type: &ScalarType,
29
+ bytes: &[u8],
30
+ field_name: &str,
31
+ ) -> Result<PolyValue> {
32
+ match scalar_type {
33
+ ScalarType::String => {
34
+ let s = std::str::from_utf8(bytes)?;
35
+ Ok(PolyValue::String(s.to_string()))
36
+ }
37
+ ScalarType::Int => {
38
+ let trimmed = trim_bytes(bytes);
39
+ let val: i64 =
40
+ lexical_core::parse(trimmed).map_err(|_| PolyXmlError::ScalarParseError {
41
+ field: field_name.to_string(),
42
+ expected: "integer",
43
+ value: String::from_utf8_lossy(bytes).to_string(),
44
+ })?;
45
+ Ok(PolyValue::Int(val))
46
+ }
47
+ ScalarType::Float => {
48
+ let trimmed = trim_bytes(bytes);
49
+ let val: f64 =
50
+ lexical_core::parse(trimmed).map_err(|_| PolyXmlError::ScalarParseError {
51
+ field: field_name.to_string(),
52
+ expected: "float",
53
+ value: String::from_utf8_lossy(bytes).to_string(),
54
+ })?;
55
+ Ok(PolyValue::Float(val))
56
+ }
57
+ ScalarType::Bool => {
58
+ let trimmed = trim_bytes(bytes);
59
+ match trimmed {
60
+ b"true" | b"1" => Ok(PolyValue::Bool(true)),
61
+ b"false" | b"0" => Ok(PolyValue::Bool(false)),
62
+ _ => Err(PolyXmlError::ScalarParseError {
63
+ field: field_name.to_string(),
64
+ expected: "boolean ('true', 'false', '1', '0')",
65
+ value: String::from_utf8_lossy(bytes).to_string(),
66
+ }),
67
+ }
68
+ }
69
+ ScalarType::Decimal
70
+ | ScalarType::XmlDate
71
+ | ScalarType::XmlDateTime
72
+ | ScalarType::XmlTime
73
+ | ScalarType::XmlDuration
74
+ | ScalarType::Any => {
75
+ let s = std::str::from_utf8(trim_bytes(bytes))?;
76
+ Ok(PolyValue::String(s.to_string()))
77
+ }
78
+ }
79
+ }
80
+ }