obis-parser 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.
@@ -0,0 +1,74 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ .Python
8
+ build/
9
+ develop-eggs/
10
+ dist/
11
+ downloads/
12
+ eggs/
13
+ .eggs/
14
+ lib/
15
+ lib64/
16
+ parts/
17
+ sdist/
18
+ var/
19
+ wheels/
20
+ share/python-wheels/
21
+ *.egg-info/
22
+ .installed.cfg
23
+ *.egg
24
+ MANIFEST
25
+
26
+ # Unit test / coverage reports
27
+ htmlcov/
28
+ .tox/
29
+ .nox/
30
+ .coverage
31
+ .coverage.*
32
+ .cache
33
+ nosetests.xml
34
+ coverage.xml
35
+ *.cover
36
+ *.py.cover
37
+ *.lcov
38
+ .pytest_cache/
39
+
40
+ # Package manager locks
41
+ uv.lock
42
+
43
+ # Translations
44
+ *.mo
45
+ *.pot
46
+
47
+ # Environments
48
+ .env
49
+ .venv
50
+ env/
51
+ venv/
52
+ ENV/
53
+ env.bak/
54
+ venv.bak/
55
+
56
+ # mypy
57
+ .mypy_cache/
58
+ .dmypy.json
59
+ dmypy.json
60
+
61
+ # Ruff
62
+ .ruff_cache/
63
+
64
+ # IDE
65
+ .idea/
66
+ .vscode/
67
+ *.swp
68
+ *.swo
69
+
70
+ # macOS
71
+ .DS_Store
72
+
73
+ # VCS version file (generated by hatch-vcs)
74
+ smgw_obis/_version.py
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright 2026 Jannick Fahlbusch
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.5
2
+ Name: obis-parser
3
+ Version: 0.0.1
4
+ Summary: Dependency-free OBIS parser and measurement catalog for smart meters and energy gateways
5
+ Project-URL: Homepage, https://github.com/jannickfahlbusch/obis-parser
6
+ Project-URL: Repository, https://github.com/jannickfahlbusch/obis-parser
7
+ Project-URL: Issues, https://github.com/jannickfahlbusch/obis-parser/issues
8
+ Project-URL: Changelog, https://github.com/jannickfahlbusch/obis-parser/blob/main/CHANGELOG.md
9
+ Author-email: Jannick Fahlbusch <git@jf-projects.de>
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: cosem,din-43863-3,energy,iec-62056-6-1,metering,obis,smart-meter,smgw,sml
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Home Automation
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: System :: Hardware
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.13
25
+ Description-Content-Type: text/markdown
26
+
27
+ # obis-parser
28
+
29
+ [![PyPI version](https://img.shields.io/pypi/v/obis-parser.svg)](https://pypi.org/project/obis-parser/)
30
+ [![Python versions](https://img.shields.io/pypi/pyversions/obis-parser.svg)](https://pypi.org/project/obis-parser/)
31
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
32
+
33
+ **Dependency-free OBIS parser and measurement catalog for smart meters and energy gateways**.
34
+
35
+ Extracts, parses, and normalizes OBIS (*Object Identification System*) codes (`A-B:C.D.E*F`) across smart meters (eHZ / mME), optical IR readouts (SML / IEC 62056-21), P1/DSMR meters, and Smart Meter Gateways (SMGW).
36
+
37
+ ---
38
+
39
+ ## Features
40
+
41
+ * **Zero External Dependencies:** Built entirely with standard library Python (`dataclasses`, `re`, `string`, `typing`).
42
+ * **Universal Ingestion:** Auto-detects and parses:
43
+ * Canonical strings: `1-0:1.8.0`, `1-0:1.8.0*255`, `1-1:1.7.0`
44
+ * Bare COSEM 12-hex: `0100010800ff`, `0100100700ff`, `010001080000` (F=0)
45
+ * COSEM logical names with meter suffixes: `0100010800ff.1lgz0067285558.sm`
46
+ * Dot-separated hex: `01.00.01.08.00.FF`
47
+ * **Single Domain Model (`OBIS`):** Everything is accessed directly on the `OBIS` instance (`.canonical`, `.name`, `.slug`, `.placeholders`, `.decode()`).
48
+ * **Channel & Tariff Qualifiers:** Treats Channel ($B \neq 0$) and Tariff ($1 \le E < 255$) as name qualifiers on $(C, D)$ base measurements.
49
+ * **4-Variant Localization Slugs:** Generates variant slugs (`base`, `_channel`, `_tariff`, `_channel_tariff`) with placeholder maps, ready for Home Assistant, Prometheus, or UI localization.
50
+ * **Curated Catalog:** 31 standard German electricity registers (DIN EN 62056-6-1 / DIN 43863-3) with units, device classes, state classes, and icons.
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install obis-parser
58
+ ```
59
+
60
+ or with [uv](https://github.com/astral-sh/uv):
61
+
62
+ ```bash
63
+ uv add obis-parser
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Quick Start
69
+
70
+ ### 1. Basic Parsing & Properties
71
+
72
+ ```python
73
+ from obis_parser import OBIS
74
+
75
+ # Parses strings, bare-hex, dot-hex, or COSEM logical names
76
+ obis = OBIS.parse("0100010800ff")
77
+ if obis:
78
+ print(obis.canonical) # "1-0:1.8.0" (or str(obis))
79
+ print(obis.name) # "Active energy import"
80
+ print(obis.slug) # "active_energy_import"
81
+ print(obis.is_electricity) # True
82
+ print(obis.channel) # 0
83
+ print(obis.tariff) # 0
84
+ ```
85
+
86
+ ### 2. Multi-Meter Channels & Tariffs
87
+
88
+ ```python
89
+ # Multi-meter behind one gateway (Channel 1, Tariff 2)
90
+ obis = OBIS.parse("1-1:1.8.2")
91
+ if obis:
92
+ print(obis.canonical) # "1-1:1.8.2"
93
+ print(obis.name) # "Active energy import (Channel 1, Tariff 2)"
94
+ print(obis.slug) # "active_energy_import_channel_tariff"
95
+ print(obis.placeholders) # {"channel": "1", "tariff": "2"}
96
+ ```
97
+
98
+ ### 3. Full Metadata Decode (`obis.decode()`)
99
+
100
+ ```python
101
+ obis = OBIS.parse("0100200700ff") # Voltage L1 (32.7.0)
102
+ if obis:
103
+ m = obis.decode()
104
+ print(m.name) # "Voltage L1"
105
+ print(m.unit) # "V"
106
+ print(m.device_class) # "voltage"
107
+ print(m.state_class) # "measurement"
108
+ print(m.icon) # "mdi:sine-wave"
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Supported Registers (Catalog Overview)
114
+
115
+ | (C, D) | Measurement | Slug | Unit | Device Class | State Class |
116
+ |---|---|---|---|---|---|
117
+ | **(1, 8)** | Active energy import | `active_energy_import` | `kWh` | `energy` | `total_increasing` |
118
+ | **(2, 8)** | Active energy export | `active_energy_export` | `kWh` | `energy` | `total_increasing` |
119
+ | **(3, 8)** | Reactive energy import | `reactive_energy_import` | `kvarh` | `reactive_energy` | `total_increasing` |
120
+ | **(4, 8)** | Reactive energy export | `reactive_energy_export` | `kvarh` | `reactive_energy` | `total_increasing` |
121
+ | **(9, 8)** | Apparent energy | `apparent_energy` | `kVAh` | `None` | `total_increasing` |
122
+ | **(1, 7)** | Active power import | `active_power_import` | `W` | `power` | `measurement` |
123
+ | **(2, 7)** | Active power export | `active_power_export` | `W` | `power` | `measurement` |
124
+ | **(3, 7)** | Reactive power import | `reactive_power_import` | `var` | `reactive_power` | `measurement` |
125
+ | **(4, 7)** | Reactive power export | `reactive_power_export` | `var` | `reactive_power` | `measurement` |
126
+ | **(9, 7)** | Apparent power | `apparent_power` | `VA` | `apparent_power` | `measurement` |
127
+ | **(16, 7)** | Active power total (net sum) | `active_power_total` | `W` | `power` | `measurement` |
128
+ | **(15, 7)** | Absolute active power (\|P\|) | `absolute_active_power` | `W` | `power` | `measurement` |
129
+ | **(36/56/76, 7)** | Active power L1/L2/L3 (signed) | `active_power_l1..3` | `W` | `power` | `measurement` |
130
+ | **(21/41/61, 7)** | Active power import L1/L2/L3 (+P) | `active_power_import_l1..3` | `W` | `power` | `measurement` |
131
+ | **(22/42/62, 7)** | Active power export L1/L2/L3 (-P) | `active_power_export_l1..3` | `W` | `power` | `measurement` |
132
+ | **(32/52/72, 7)** | Voltage L1/L2/L3 | `voltage_l1..3` | `V` | `voltage` | `measurement` |
133
+ | **(12, 7)** | Voltage (total/RMS) | `voltage` | `V` | `voltage` | `measurement` |
134
+ | **(31/51/71, 7)** | Current L1/L2/L3 | `current_l1..3` | `A` | `current` | `measurement` |
135
+ | **(11, 7)** | Current (neutral/total) | `current` | `A` | `current` | `measurement` |
136
+ | **(13, 7)** | Power factor ($\cos \varphi$) | `power_factor` | `None` | `power_factor` | `measurement` |
137
+ | **(14, 7)** | Frequency | `frequency` | `Hz` | `frequency` | `measurement` |
138
+
139
+ ---
140
+
141
+ ## License
142
+
143
+ Apache 2.0. Copyright 2026 Jannick Fahlbusch.
@@ -0,0 +1,117 @@
1
+ # obis-parser
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/obis-parser.svg)](https://pypi.org/project/obis-parser/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/obis-parser.svg)](https://pypi.org/project/obis-parser/)
5
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+
7
+ **Dependency-free OBIS parser and measurement catalog for smart meters and energy gateways**.
8
+
9
+ Extracts, parses, and normalizes OBIS (*Object Identification System*) codes (`A-B:C.D.E*F`) across smart meters (eHZ / mME), optical IR readouts (SML / IEC 62056-21), P1/DSMR meters, and Smart Meter Gateways (SMGW).
10
+
11
+ ---
12
+
13
+ ## Features
14
+
15
+ * **Zero External Dependencies:** Built entirely with standard library Python (`dataclasses`, `re`, `string`, `typing`).
16
+ * **Universal Ingestion:** Auto-detects and parses:
17
+ * Canonical strings: `1-0:1.8.0`, `1-0:1.8.0*255`, `1-1:1.7.0`
18
+ * Bare COSEM 12-hex: `0100010800ff`, `0100100700ff`, `010001080000` (F=0)
19
+ * COSEM logical names with meter suffixes: `0100010800ff.1lgz0067285558.sm`
20
+ * Dot-separated hex: `01.00.01.08.00.FF`
21
+ * **Single Domain Model (`OBIS`):** Everything is accessed directly on the `OBIS` instance (`.canonical`, `.name`, `.slug`, `.placeholders`, `.decode()`).
22
+ * **Channel & Tariff Qualifiers:** Treats Channel ($B \neq 0$) and Tariff ($1 \le E < 255$) as name qualifiers on $(C, D)$ base measurements.
23
+ * **4-Variant Localization Slugs:** Generates variant slugs (`base`, `_channel`, `_tariff`, `_channel_tariff`) with placeholder maps, ready for Home Assistant, Prometheus, or UI localization.
24
+ * **Curated Catalog:** 31 standard German electricity registers (DIN EN 62056-6-1 / DIN 43863-3) with units, device classes, state classes, and icons.
25
+
26
+ ---
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ pip install obis-parser
32
+ ```
33
+
34
+ or with [uv](https://github.com/astral-sh/uv):
35
+
36
+ ```bash
37
+ uv add obis-parser
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Quick Start
43
+
44
+ ### 1. Basic Parsing & Properties
45
+
46
+ ```python
47
+ from obis_parser import OBIS
48
+
49
+ # Parses strings, bare-hex, dot-hex, or COSEM logical names
50
+ obis = OBIS.parse("0100010800ff")
51
+ if obis:
52
+ print(obis.canonical) # "1-0:1.8.0" (or str(obis))
53
+ print(obis.name) # "Active energy import"
54
+ print(obis.slug) # "active_energy_import"
55
+ print(obis.is_electricity) # True
56
+ print(obis.channel) # 0
57
+ print(obis.tariff) # 0
58
+ ```
59
+
60
+ ### 2. Multi-Meter Channels & Tariffs
61
+
62
+ ```python
63
+ # Multi-meter behind one gateway (Channel 1, Tariff 2)
64
+ obis = OBIS.parse("1-1:1.8.2")
65
+ if obis:
66
+ print(obis.canonical) # "1-1:1.8.2"
67
+ print(obis.name) # "Active energy import (Channel 1, Tariff 2)"
68
+ print(obis.slug) # "active_energy_import_channel_tariff"
69
+ print(obis.placeholders) # {"channel": "1", "tariff": "2"}
70
+ ```
71
+
72
+ ### 3. Full Metadata Decode (`obis.decode()`)
73
+
74
+ ```python
75
+ obis = OBIS.parse("0100200700ff") # Voltage L1 (32.7.0)
76
+ if obis:
77
+ m = obis.decode()
78
+ print(m.name) # "Voltage L1"
79
+ print(m.unit) # "V"
80
+ print(m.device_class) # "voltage"
81
+ print(m.state_class) # "measurement"
82
+ print(m.icon) # "mdi:sine-wave"
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Supported Registers (Catalog Overview)
88
+
89
+ | (C, D) | Measurement | Slug | Unit | Device Class | State Class |
90
+ |---|---|---|---|---|---|
91
+ | **(1, 8)** | Active energy import | `active_energy_import` | `kWh` | `energy` | `total_increasing` |
92
+ | **(2, 8)** | Active energy export | `active_energy_export` | `kWh` | `energy` | `total_increasing` |
93
+ | **(3, 8)** | Reactive energy import | `reactive_energy_import` | `kvarh` | `reactive_energy` | `total_increasing` |
94
+ | **(4, 8)** | Reactive energy export | `reactive_energy_export` | `kvarh` | `reactive_energy` | `total_increasing` |
95
+ | **(9, 8)** | Apparent energy | `apparent_energy` | `kVAh` | `None` | `total_increasing` |
96
+ | **(1, 7)** | Active power import | `active_power_import` | `W` | `power` | `measurement` |
97
+ | **(2, 7)** | Active power export | `active_power_export` | `W` | `power` | `measurement` |
98
+ | **(3, 7)** | Reactive power import | `reactive_power_import` | `var` | `reactive_power` | `measurement` |
99
+ | **(4, 7)** | Reactive power export | `reactive_power_export` | `var` | `reactive_power` | `measurement` |
100
+ | **(9, 7)** | Apparent power | `apparent_power` | `VA` | `apparent_power` | `measurement` |
101
+ | **(16, 7)** | Active power total (net sum) | `active_power_total` | `W` | `power` | `measurement` |
102
+ | **(15, 7)** | Absolute active power (\|P\|) | `absolute_active_power` | `W` | `power` | `measurement` |
103
+ | **(36/56/76, 7)** | Active power L1/L2/L3 (signed) | `active_power_l1..3` | `W` | `power` | `measurement` |
104
+ | **(21/41/61, 7)** | Active power import L1/L2/L3 (+P) | `active_power_import_l1..3` | `W` | `power` | `measurement` |
105
+ | **(22/42/62, 7)** | Active power export L1/L2/L3 (-P) | `active_power_export_l1..3` | `W` | `power` | `measurement` |
106
+ | **(32/52/72, 7)** | Voltage L1/L2/L3 | `voltage_l1..3` | `V` | `voltage` | `measurement` |
107
+ | **(12, 7)** | Voltage (total/RMS) | `voltage` | `V` | `voltage` | `measurement` |
108
+ | **(31/51/71, 7)** | Current L1/L2/L3 | `current_l1..3` | `A` | `current` | `measurement` |
109
+ | **(11, 7)** | Current (neutral/total) | `current` | `A` | `current` | `measurement` |
110
+ | **(13, 7)** | Power factor ($\cos \varphi$) | `power_factor` | `None` | `power_factor` | `measurement` |
111
+ | **(14, 7)** | Frequency | `frequency` | `Hz` | `frequency` | `measurement` |
112
+
113
+ ---
114
+
115
+ ## License
116
+
117
+ Apache 2.0. Copyright 2026 Jannick Fahlbusch.
@@ -0,0 +1,71 @@
1
+ """Dependency-free OBIS parser and measurement catalog for smart meters and energy gateways.
2
+
3
+ Usage examples:
4
+ >>> from obis_parser import OBIS
5
+ >>>
6
+ >>> # 1. Parse and access properties
7
+ >>> obis = OBIS.parse("0100010800ff")
8
+ >>> obis.canonical
9
+ '1-0:1.8.0'
10
+ >>> obis.name
11
+ 'Active energy import'
12
+ >>> obis.slug
13
+ 'active_energy_import'
14
+ >>>
15
+ >>> # 2. Multi-meter channels and dynamic tariffs
16
+ >>> obis = OBIS.parse("1-1:1.8.2")
17
+ >>> obis.name
18
+ 'Active energy import (Channel 1, Tariff 2)'
19
+ >>> obis.slug
20
+ 'active_energy_import_channel_tariff'
21
+ >>> obis.placeholders
22
+ {'channel': '1', 'tariff': '2'}
23
+ >>>
24
+ >>> # 3. Full metadata decode
25
+ >>> m = obis.decode()
26
+ >>> m.unit
27
+ 'kWh'
28
+ >>> m.device_class
29
+ 'energy'
30
+ """
31
+
32
+ from ._version import __version__, __version_tuple__
33
+ from .core import (
34
+ ELECTRICITY_MEDIUM,
35
+ OBIS,
36
+ OBIS_CATALOG,
37
+ MeasurementKey,
38
+ OBISBillingPeriod,
39
+ OBISChannel,
40
+ OBISDeviceClass,
41
+ OBISMeasurement,
42
+ OBISMeasurementInfo,
43
+ OBISMeasurementType,
44
+ OBISMedium,
45
+ OBISNameDescriptor,
46
+ OBISPhysicalQuantity,
47
+ OBISStateClass,
48
+ OBISTariff,
49
+ ParsedOBIS,
50
+ )
51
+
52
+ __all__ = [
53
+ "ELECTRICITY_MEDIUM",
54
+ "OBIS",
55
+ "OBIS_CATALOG",
56
+ "MeasurementKey",
57
+ "OBISBillingPeriod",
58
+ "OBISChannel",
59
+ "OBISDeviceClass",
60
+ "OBISMeasurement",
61
+ "OBISMeasurementInfo",
62
+ "OBISMeasurementType",
63
+ "OBISMedium",
64
+ "OBISNameDescriptor",
65
+ "OBISPhysicalQuantity",
66
+ "OBISStateClass",
67
+ "OBISTariff",
68
+ "ParsedOBIS",
69
+ "__version__",
70
+ "__version_tuple__",
71
+ ]
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.0.1'
22
+ __version_tuple__ = version_tuple = (0, 0, 1)
23
+
24
+ __commit_id__ = commit_id = None