pymbusparser 0.3.0__tar.gz → 0.4.2__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 (56) hide show
  1. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/.github/workflows/rust.yml +27 -30
  2. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/CHANGELOG.md +67 -0
  3. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/Cargo.lock +239 -78
  4. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/Cargo.toml +7 -6
  5. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/PKG-INFO +9 -5
  6. pymbusparser-0.4.2/README.md +308 -0
  7. {pymbusparser-0.3.0/python → pymbusparser-0.4.2}/README_python.md +8 -4
  8. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/Cargo.toml +2 -2
  9. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-core/Cargo.toml +1 -1
  10. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/wired-mbus-link-layer/Cargo.toml +2 -2
  11. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/wireless-mbus-link-layer/Cargo.toml +2 -2
  12. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/wireless-mbus-link-layer/src/lib.rs +31 -3
  13. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/docs/index.html +371 -130
  14. pymbusparser-0.4.2/docs/m_bus_parser_wasm_pack.js +454 -0
  15. pymbusparser-0.4.2/docs/m_bus_parser_wasm_pack_bg.wasm +0 -0
  16. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/python/Cargo.toml +2 -2
  17. {pymbusparser-0.3.0 → pymbusparser-0.4.2/python}/README_python.md +8 -4
  18. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/python/pymbusparser.pyi +11 -1
  19. pymbusparser-0.4.2/python/src/lib.rs +220 -0
  20. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/python/tests/test_bindings.py +20 -4
  21. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/src/annotate.rs +7 -2
  22. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/src/lib.rs +8 -0
  23. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/src/mbus_data.rs +140 -77
  24. pymbusparser-0.4.2/src/output.rs +2793 -0
  25. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/src/rscada_xml.rs +273 -11
  26. pymbusparser-0.3.0/README.md +0 -307
  27. pymbusparser-0.3.0/docs/m_bus_parser_wasm_pack.js +0 -254
  28. pymbusparser-0.3.0/docs/m_bus_parser_wasm_pack_bg.wasm +0 -0
  29. pymbusparser-0.3.0/docs/package.json +0 -31
  30. pymbusparser-0.3.0/python/src/lib.rs +0 -242
  31. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/.github/dependabot.yml +0 -0
  32. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/.github/workflows/python.yml +0 -0
  33. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/.gitignore +0 -0
  34. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/.vscode/launch.json +0 -0
  35. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/.vscode/settings.json +0 -0
  36. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/CONTRIBUTING.md +0 -0
  37. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/LICENSE +0 -0
  38. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/benches/bench.rs +0 -0
  39. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/.gitignore +0 -0
  40. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/README.md +0 -0
  41. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/examples/parse_data_records.rs +0 -0
  42. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/src/data_information.rs +0 -0
  43. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/src/data_record.rs +0 -0
  44. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/src/extended_link_layer.rs +0 -0
  45. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/src/lib.rs +0 -0
  46. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/src/value_information.rs +0 -0
  47. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-application-layer/src/variable_user_data.rs +0 -0
  48. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-core/src/decryption.rs +0 -0
  49. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/m-bus-core/src/lib.rs +0 -0
  50. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/crates/wired-mbus-link-layer/src/lib.rs +0 -0
  51. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/docs/m_bus_parser_wasm_pack_bg.js +0 -0
  52. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/docs/meter.png +0 -0
  53. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/pyproject.toml +0 -0
  54. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/python/.gitignore +0 -0
  55. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/python/py.typed +0 -0
  56. {pymbusparser-0.3.0 → pymbusparser-0.4.2}/src/manufacturers.rs +0 -0
@@ -90,6 +90,12 @@ jobs:
90
90
  run: |
91
91
  cd wasm
92
92
  cargo test --verbose
93
+ - name: Install wasm-pack
94
+ run: cargo install wasm-pack --locked
95
+ - name: Run WASM browser tests
96
+ run: |
97
+ cd wasm
98
+ wasm-pack test --headless --firefox
93
99
  - name: Lint WASM with Clippy
94
100
  run: |
95
101
  rustup component add clippy
@@ -114,40 +120,45 @@ jobs:
114
120
  - name: Publish Library to crates.io
115
121
  env:
116
122
  CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
117
- RELEASE_REF_NAME: ${{ github.ref_name }}
118
123
  run: |
119
124
  set -euo pipefail
120
125
 
121
- VERSION="${RELEASE_REF_NAME#v}"
122
126
  CRATES_USER_AGENT="m-bus-parser-release-workflow (https://github.com/maebli/m-bus-parser)"
123
127
 
124
128
  crate_exists() {
125
- curl -fsS -A "$CRATES_USER_AGENT" "https://crates.io/api/v1/crates/$1/$VERSION" >/dev/null
129
+ curl -fsS -A "$CRATES_USER_AGENT" "https://crates.io/api/v1/crates/$1/$2" >/dev/null
126
130
  }
127
131
 
128
132
  wait_for_crate() {
129
133
  crate="$1"
134
+ version="$2"
130
135
  for _ in {1..40}; do
131
- if crate_exists "$crate"; then
136
+ if crate_exists "$crate" "$version"; then
132
137
  return 0
133
138
  fi
134
139
  sleep 15
135
140
  done
136
141
 
137
- echo "$crate $VERSION did not appear on crates.io"
142
+ echo "$crate $version did not appear on crates.io"
138
143
  return 1
139
144
  }
140
145
 
141
146
  publish_crate() {
142
147
  crate="$1"
143
148
  manifest="$2"
144
- if crate_exists "$crate"; then
145
- echo "$crate $VERSION is already published"
149
+ manifest_path="$(realpath "$manifest")"
150
+ version="$(
151
+ cargo metadata --manifest-path "$manifest" --no-deps --format-version 1 |
152
+ jq -r --arg manifest_path "$manifest_path" \
153
+ '.packages[] | select(.manifest_path == $manifest_path) | .version'
154
+ )"
155
+ if crate_exists "$crate" "$version"; then
156
+ echo "$crate $version is already published"
146
157
  return 0
147
158
  fi
148
159
 
149
160
  cargo publish --manifest-path "$manifest"
150
- wait_for_crate "$crate"
161
+ wait_for_crate "$crate" "$version"
151
162
  }
152
163
 
153
164
  publish_crate m-bus-core crates/m-bus-core/Cargo.toml
@@ -234,32 +245,18 @@ jobs:
234
245
  node-version: '24'
235
246
  registry-url: 'https://registry.npmjs.org'
236
247
  package-manager-cache: false
237
- - name: Install npm dependencies
238
- run: |
239
- cd wasm/pkg
240
- npm install
241
- npm ci
242
- - name: Publish to npm
243
- run: |
244
- cd wasm/pkg
245
- VERSION="$(node -e "const fs=require('fs'); console.log(JSON.parse(fs.readFileSync('package.json','utf8')).version)")"
246
- if npm view "m-bus-parser-wasm-pack@$VERSION" version >/dev/null 2>&1; then
247
- echo "m-bus-parser-wasm-pack $VERSION is already published"
248
- else
249
- npm publish --access public
250
- fi
248
+ - name: Publish WASM package
249
+ run: wasm-pack publish --access public wasm
251
250
  - name: Create new artifacts for website
252
251
  run: |
253
- rm -rf wasm/pkg
254
252
  cd wasm
255
- wasm-pack build --target web
253
+ wasm-pack build --target web --out-dir pkg-web
256
254
  - name: Copy wasm artifacts to docs
257
255
  run: |
258
- cp wasm/pkg/m_bus_parser_wasm_pack.js docs/
259
- cp wasm/pkg/m_bus_parser_wasm_pack_bg.wasm docs/
260
- cp wasm/pkg/package.json docs/
261
- if [ -f wasm/pkg/m_bus_parser_wasm_pack_bg.js ]; then
262
- cp wasm/pkg/m_bus_parser_wasm_pack_bg.js docs/
256
+ cp wasm/pkg-web/m_bus_parser_wasm_pack.js docs/
257
+ cp wasm/pkg-web/m_bus_parser_wasm_pack_bg.wasm docs/
258
+ if [ -f wasm/pkg-web/m_bus_parser_wasm_pack_bg.js ]; then
259
+ cp wasm/pkg-web/m_bus_parser_wasm_pack_bg.js docs/
263
260
  fi
264
261
  - name: Commit updated wasm artifacts
265
262
  env:
@@ -267,6 +264,6 @@ jobs:
267
264
  run: |
268
265
  git config user.name "github-actions"
269
266
  git config user.email "github-actions@github.com"
270
- git add docs/m_bus_parser_wasm_pack.js docs/m_bus_parser_wasm_pack_bg.js docs/m_bus_parser_wasm_pack_bg.wasm docs/meter.png docs/package.json
267
+ git add docs/m_bus_parser_wasm_pack.js docs/m_bus_parser_wasm_pack_bg.js docs/m_bus_parser_wasm_pack_bg.wasm docs/meter.png
271
268
  git commit -m "Update docs wasm artifacts" || echo "No changes to commit"
272
269
  git push origin HEAD:main
@@ -7,6 +7,73 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.2] - 2026-08-10
11
+
12
+ ### Changed
13
+
14
+ - Simplified canonical record units to a single `unit` string. It contains the
15
+ standardized representation when available, without exposing a technical
16
+ `ucum` label, and falls back to the human-readable symbol for units without a
17
+ standard mapping. This change advances the canonical output schema to
18
+ version 2.
19
+ - Aligned canonical frame functions, record functions, quantities, and data
20
+ coding names with M-Bus terminology (`RSP_UD`, `Instantaneous value`,
21
+ `Volume flow`, `6-digit BCD`) across JSON, YAML, CSV, tables, Mermaid, Python,
22
+ and WebAssembly. Annotation identifiers now use `snake_case`, and standalone
23
+ application-record decoding now uses the same canonical record contract.
24
+
25
+ ## [0.4.1]
26
+
27
+ ### Changed
28
+
29
+ - Replaced the npm-based documentation highlighter with `syntect` running
30
+ inside the Rust WebAssembly package. JSON, YAML, CSV, and XML now use
31
+ prefixed semantic token classes and an audited high-contrast light/dark
32
+ palette.
33
+ - CSV renders one row per input frame, with data records represented as
34
+ namespaced columns instead of repeating frame metadata for every record.
35
+
36
+ ### Fixed
37
+
38
+ - Removed doubled source lines that introduced blank gaps in JSON, CSV, and
39
+ XML and caused line-number gutters to end halfway through long outputs.
40
+ - Restored semantic grouping and the high-contrast eight-color data-record
41
+ palette in Mermaid diagrams.
42
+
43
+ ## [0.4.0]
44
+
45
+ ### Added
46
+
47
+ - A versioned canonical output schema shared by Rust, CLI, Python, and WASM,
48
+ with exact decimal values, source provenance, partial-decode diagnostics,
49
+ stable error codes, and optional manufacturer enrichment.
50
+ - Typed `decode_*` and `render_*` Rust APIs, a native-object WASM decoder, a
51
+ custom Python exception, strict hexadecimal input, and explicit render
52
+ options.
53
+ - Responsive Unicode-aware tables that adapt between wide, compact, and
54
+ vertical layouts without exceeding the requested terminal or container
55
+ width.
56
+ - Self-hosted Shiki syntax highlighting for JSON, YAML, CSV, and XML in the
57
+ WASM documentation, with light/dark high-contrast themes, line numbers,
58
+ keyboard scrolling, forced-colors support, and automated WCAG AA checks.
59
+
60
+ ### Changed
61
+
62
+ - JSON, YAML, CSV, table, Mermaid, annotated, XML, and binding outputs now use
63
+ one product-owned contract. Retained legacy serializers are available under
64
+ explicit legacy format names through this compatibility release.
65
+ - Wireless link frames preserve the raw C-field and expose the decoded
66
+ function only when the value is known.
67
+
68
+ ### Fixed
69
+
70
+ - XML rendering now supports clear, encrypted, short/long transport, and ELL
71
+ wireless M-Bus frames while retaining byte-for-byte wired libmbus parity.
72
+ - Tables no longer wrap or mangle inside narrow terminals and browser output
73
+ cards.
74
+ - Syntax tokens and line-number gutters meet the WCAG 2.2 AA 4.5:1 text
75
+ contrast threshold in both supported themes.
76
+
10
77
  ## [0.3.0]
11
78
 
12
79
  ### Added