pymbusparser 0.0.1__cp312-none-win_amd64.whl
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.
pymbusparser/__init__.py
ADDED
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: pymbusparser
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Python bindings for m-bus-parser written in Rust
|
|
5
|
+
Home-Page: https://maebli.github.io/
|
|
6
|
+
Author-email: Michael Aebli <>
|
|
7
|
+
License: MIT
|
|
8
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
9
|
+
Project-URL: Source Code, https://github.com/maebli/m-bus-parser
|
|
10
|
+
|
|
11
|
+
# Python bindings [WIP]
|
|
12
|
+
|
|
13
|
+
Rust lib aims to be accessible from a Python module. This is done by using the `PyO3` crate.
|
|
14
|
+
|
|
15
|
+
## Development
|
|
16
|
+
|
|
17
|
+
- `pipx install maturin` to install `maturin` globally.
|
|
18
|
+
- `maturin develop` to build the Rust lib and create a Python module in the current environment.
|
|
19
|
+
- Currently this creates a release in the target directory that is one hierachy up. This is not ideal and will be fixed in the future.
|
|
20
|
+
- after calling the maturin develop command cd one up and `pip install target/..` and then run `python` and `from pymbusparser import pymbus` to test the module.
|
|
21
|
+
- to test inside `REPL` run `python` and then `import p
|
|
22
|
+
|
|
23
|
+
## Publishing
|
|
24
|
+
|
|
25
|
+
- `maturin publish`
|
|
26
|
+
- username = __token__
|
|
27
|
+
- passwrod = api key from pypi
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
`pip install pymbusparser`
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from pymbusparser import m_bus_parse,parse_application_layer
|
|
35
|
+
|
|
36
|
+
print(m_bus_parse("68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E 16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16","table"))
|
|
37
|
+
|
|
38
|
+
print(m_bus_parse("68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E 16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16","json"))
|
|
39
|
+
|
|
40
|
+
print(m_bus_parse("68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E )16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16","yml"))
|
|
41
|
+
|
|
42
|
+
# note this is not as pretty as the function before, still TODO, currently it just outputs structs of RUST in string
|
|
43
|
+
print(parse_application_layer("2f2f0413fce0f5052f2f2f2f2f2f2f2f"))
|
|
44
|
+
|
|
45
|
+
```
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
pymbusparser-0.0.1.dist-info/METADATA,sha256=1zfr14jwKQf1dHHgNVpCIEDXSD5_mUXKqMnnHdjWjqM,2090
|
|
2
|
+
pymbusparser-0.0.1.dist-info/WHEEL,sha256=f0Nk2GWSn9ojh4Dg27z93x-XiE29zKB1_Q0LUcX-tdw,95
|
|
3
|
+
pymbusparser/__init__.py,sha256=EkkwkeIxgF4MRAZhtqlUevJK1RFTfQ7tzQlu40vXZ1k,131
|
|
4
|
+
pymbusparser/pymbusparser.cp312-win_amd64.pyd,sha256=YaOaYAh_uzA91XaKhUC05sWpH2SMBupiP25S-u4uAV8,421376
|
|
5
|
+
pymbusparser-0.0.1.dist-info/RECORD,,
|