py20305 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 (184) hide show
  1. py20305-0.1.0/LICENSE +201 -0
  2. py20305-0.1.0/NOTICE +5 -0
  3. py20305-0.1.0/PKG-INFO +230 -0
  4. py20305-0.1.0/README.md +179 -0
  5. py20305-0.1.0/pyproject.toml +123 -0
  6. py20305-0.1.0/setup.cfg +4 -0
  7. py20305-0.1.0/src/py20305/__init__.py +1 -0
  8. py20305-0.1.0/src/py20305/__main__.py +7 -0
  9. py20305-0.1.0/src/py20305/api/__init__.py +14 -0
  10. py20305-0.1.0/src/py20305/api/app.py +106 -0
  11. py20305-0.1.0/src/py20305/api/client_routes.py +336 -0
  12. py20305-0.1.0/src/py20305/api/serializers.py +195 -0
  13. py20305-0.1.0/src/py20305/api/service.py +423 -0
  14. py20305-0.1.0/src/py20305/cli.py +758 -0
  15. py20305-0.1.0/src/py20305/client/__init__.py +98 -0
  16. py20305-0.1.0/src/py20305/client/connector.py +87 -0
  17. py20305-0.1.0/src/py20305/client/csip_client.py +1446 -0
  18. py20305-0.1.0/src/py20305/client/discovery.py +1091 -0
  19. py20305-0.1.0/src/py20305/client/errors.py +128 -0
  20. py20305-0.1.0/src/py20305/client/http.py +1357 -0
  21. py20305-0.1.0/src/py20305/client/poll_rate.py +36 -0
  22. py20305-0.1.0/src/py20305/client/polling.py +270 -0
  23. py20305-0.1.0/src/py20305/client/redirect_probe.py +78 -0
  24. py20305-0.1.0/src/py20305/client/retry.py +220 -0
  25. py20305-0.1.0/src/py20305/client/state.py +238 -0
  26. py20305-0.1.0/src/py20305/client/timebase.py +168 -0
  27. py20305-0.1.0/src/py20305/client/tls.py +181 -0
  28. py20305-0.1.0/src/py20305/client/traffic_recorder.py +129 -0
  29. py20305-0.1.0/src/py20305/commands.py +142 -0
  30. py20305-0.1.0/src/py20305/config.py +369 -0
  31. py20305-0.1.0/src/py20305/connectors/__init__.py +37 -0
  32. py20305-0.1.0/src/py20305/connectors/base.py +493 -0
  33. py20305-0.1.0/src/py20305/connectors/config.py +134 -0
  34. py20305-0.1.0/src/py20305/connectors/control_errors.py +82 -0
  35. py20305-0.1.0/src/py20305/connectors/device_telemetry.py +335 -0
  36. py20305-0.1.0/src/py20305/connectors/dispatcher.py +552 -0
  37. py20305-0.1.0/src/py20305/connectors/errors.py +52 -0
  38. py20305-0.1.0/src/py20305/connectors/modes.py +970 -0
  39. py20305-0.1.0/src/py20305/connectors/print_demo.py +319 -0
  40. py20305-0.1.0/src/py20305/connectors/registry.py +334 -0
  41. py20305-0.1.0/src/py20305/connectors/sunspec.py +42 -0
  42. py20305-0.1.0/src/py20305/connectors/sunspec_connector_points.txt +164 -0
  43. py20305-0.1.0/src/py20305/connectors/sunspec_core/__init__.py +48 -0
  44. py20305-0.1.0/src/py20305/connectors/sunspec_core/_modbus.py +1170 -0
  45. py20305-0.1.0/src/py20305/connectors/translation.py +387 -0
  46. py20305-0.1.0/src/py20305/diagnostics.py +309 -0
  47. py20305-0.1.0/src/py20305/events/__init__.py +1 -0
  48. py20305-0.1.0/src/py20305/events/active_modes.py +49 -0
  49. py20305-0.1.0/src/py20305/events/comms_loss.py +24 -0
  50. py20305-0.1.0/src/py20305/events/current_controls.py +70 -0
  51. py20305-0.1.0/src/py20305/events/dderc.py +85 -0
  52. py20305-0.1.0/src/py20305/events/dispatch.py +163 -0
  53. py20305-0.1.0/src/py20305/events/modes_bitmask.py +69 -0
  54. py20305-0.1.0/src/py20305/events/processor.py +1570 -0
  55. py20305-0.1.0/src/py20305/events/randomization.py +83 -0
  56. py20305-0.1.0/src/py20305/events/response.py +392 -0
  57. py20305-0.1.0/src/py20305/events/state_machine.py +109 -0
  58. py20305-0.1.0/src/py20305/events/supersession.py +135 -0
  59. py20305-0.1.0/src/py20305/events/tariff.py +320 -0
  60. py20305-0.1.0/src/py20305/events/timers.py +207 -0
  61. py20305-0.1.0/src/py20305/forwarders/__init__.py +64 -0
  62. py20305-0.1.0/src/py20305/forwarders/base.py +227 -0
  63. py20305-0.1.0/src/py20305/forwarders/config.py +166 -0
  64. py20305-0.1.0/src/py20305/forwarders/lfdi_extraction.py +195 -0
  65. py20305-0.1.0/src/py20305/forwarders/manager.py +304 -0
  66. py20305-0.1.0/src/py20305/forwarders/mqtt_adapter.py +352 -0
  67. py20305-0.1.0/src/py20305/forwarders/mqtt_forwarder.py +444 -0
  68. py20305-0.1.0/src/py20305/forwarders/types.py +538 -0
  69. py20305-0.1.0/src/py20305/json_form.py +415 -0
  70. py20305-0.1.0/src/py20305/models/__init__.py +31 -0
  71. py20305-0.1.0/src/py20305/models/csipaus/__init__.py +25 -0
  72. py20305-0.1.0/src/py20305/models/csipaus/csipaus_ext.py +119 -0
  73. py20305-0.1.0/src/py20305/models/sep/__init__.py +991 -0
  74. py20305-0.1.0/src/py20305/models/sep/sep.py +20466 -0
  75. py20305-0.1.0/src/py20305/readings.py +355 -0
  76. py20305-0.1.0/src/py20305/schemas/csipaus-core-v1.3-beta_storage.xsd +96 -0
  77. py20305-0.1.0/src/py20305/schemas/csipaus-core.xsd +76 -0
  78. py20305-0.1.0/src/py20305/schemas/csipaus-ext-v1.3-beta_storage.xsd +67 -0
  79. py20305-0.1.0/src/py20305/schemas/csipaus-ext.xsd +51 -0
  80. py20305-0.1.0/src/py20305/schemas/sep2_schema_2018.xsd +6923 -0
  81. py20305-0.1.0/src/py20305/schemas/sep2_schema_2023.xsd +10450 -0
  82. py20305-0.1.0/src/py20305/schemas/wadl.xsd +216 -0
  83. py20305-0.1.0/src/py20305/schemas/wadlExt.xsd +25 -0
  84. py20305-0.1.0/src/py20305/security/__init__.py +18 -0
  85. py20305-0.1.0/src/py20305/security/identity.py +83 -0
  86. py20305-0.1.0/src/py20305/subscription/__init__.py +23 -0
  87. py20305-0.1.0/src/py20305/subscription/manager.py +836 -0
  88. py20305-0.1.0/src/py20305/subscription/notification_server.py +374 -0
  89. py20305-0.1.0/src/py20305/telemetry/__init__.py +24 -0
  90. py20305-0.1.0/src/py20305/telemetry/der_availability.py +78 -0
  91. py20305-0.1.0/src/py20305/telemetry/der_capability.py +111 -0
  92. py20305-0.1.0/src/py20305/telemetry/der_resource_manager.py +407 -0
  93. py20305-0.1.0/src/py20305/telemetry/der_settings.py +118 -0
  94. py20305-0.1.0/src/py20305/telemetry/der_status.py +207 -0
  95. py20305-0.1.0/src/py20305/telemetry/log_events.py +184 -0
  96. py20305-0.1.0/src/py20305/telemetry/manager.py +1008 -0
  97. py20305-0.1.0/src/py20305/telemetry/mup.py +693 -0
  98. py20305-0.1.0/src/py20305/telemetry/scale_factor.py +214 -0
  99. py20305-0.1.0/src/py20305/telemetry/scaling.py +115 -0
  100. py20305-0.1.0/src/py20305/version_info.py +54 -0
  101. py20305-0.1.0/src/py20305/xml/__init__.py +15 -0
  102. py20305-0.1.0/src/py20305/xml/serialization.py +201 -0
  103. py20305-0.1.0/src/py20305.egg-info/PKG-INFO +230 -0
  104. py20305-0.1.0/src/py20305.egg-info/SOURCES.txt +182 -0
  105. py20305-0.1.0/src/py20305.egg-info/dependency_links.txt +1 -0
  106. py20305-0.1.0/src/py20305.egg-info/entry_points.txt +2 -0
  107. py20305-0.1.0/src/py20305.egg-info/requires.txt +40 -0
  108. py20305-0.1.0/src/py20305.egg-info/top_level.txt +1 -0
  109. py20305-0.1.0/tests/test_cli.py +642 -0
  110. py20305-0.1.0/tests/test_client.py +451 -0
  111. py20305-0.1.0/tests/test_client_api_service.py +407 -0
  112. py20305-0.1.0/tests/test_client_errors.py +116 -0
  113. py20305-0.1.0/tests/test_client_protocol.py +897 -0
  114. py20305-0.1.0/tests/test_client_routes.py +237 -0
  115. py20305-0.1.0/tests/test_comms_loss_recovery.py +152 -0
  116. py20305-0.1.0/tests/test_config.py +203 -0
  117. py20305-0.1.0/tests/test_connectors_base.py +114 -0
  118. py20305-0.1.0/tests/test_connectors_modes.py +966 -0
  119. py20305-0.1.0/tests/test_connectors_print_demo.py +120 -0
  120. py20305-0.1.0/tests/test_connectors_registry.py +440 -0
  121. py20305-0.1.0/tests/test_connectors_sunspec.py +1680 -0
  122. py20305-0.1.0/tests/test_connectors_translation.py +321 -0
  123. py20305-0.1.0/tests/test_csip_client.py +1650 -0
  124. py20305-0.1.0/tests/test_deployment_examples.py +109 -0
  125. py20305-0.1.0/tests/test_der_resource_manager.py +370 -0
  126. py20305-0.1.0/tests/test_device_telemetry.py +1188 -0
  127. py20305-0.1.0/tests/test_diagnostics_report.py +110 -0
  128. py20305-0.1.0/tests/test_diagnostics_store.py +213 -0
  129. py20305-0.1.0/tests/test_discovery.py +1929 -0
  130. py20305-0.1.0/tests/test_discovery_tariff.py +192 -0
  131. py20305-0.1.0/tests/test_docker.py +208 -0
  132. py20305-0.1.0/tests/test_events_active_modes.py +57 -0
  133. py20305-0.1.0/tests/test_events_current_controls.py +45 -0
  134. py20305-0.1.0/tests/test_events_dderc.py +156 -0
  135. py20305-0.1.0/tests/test_events_dispatch.py +62 -0
  136. py20305-0.1.0/tests/test_events_modes_bitmask.py +85 -0
  137. py20305-0.1.0/tests/test_events_processor.py +3462 -0
  138. py20305-0.1.0/tests/test_events_randomization.py +155 -0
  139. py20305-0.1.0/tests/test_events_response.py +545 -0
  140. py20305-0.1.0/tests/test_events_state_machine.py +152 -0
  141. py20305-0.1.0/tests/test_events_supersession.py +289 -0
  142. py20305-0.1.0/tests/test_events_timers.py +211 -0
  143. py20305-0.1.0/tests/test_extraction_regressions.py +279 -0
  144. py20305-0.1.0/tests/test_forwarders_base.py +197 -0
  145. py20305-0.1.0/tests/test_forwarders_config.py +109 -0
  146. py20305-0.1.0/tests/test_forwarders_lfdi_extraction.py +213 -0
  147. py20305-0.1.0/tests/test_forwarders_manager.py +322 -0
  148. py20305-0.1.0/tests/test_forwarders_mqtt.py +374 -0
  149. py20305-0.1.0/tests/test_forwarders_mqtt_adapter.py +635 -0
  150. py20305-0.1.0/tests/test_forwarders_types.py +284 -0
  151. py20305-0.1.0/tests/test_identity.py +83 -0
  152. py20305-0.1.0/tests/test_import_isolation.py +46 -0
  153. py20305-0.1.0/tests/test_models.py +68 -0
  154. py20305-0.1.0/tests/test_poll_rate.py +44 -0
  155. py20305-0.1.0/tests/test_polling.py +517 -0
  156. py20305-0.1.0/tests/test_pricing_api.py +118 -0
  157. py20305-0.1.0/tests/test_redirect_probe.py +182 -0
  158. py20305-0.1.0/tests/test_retry.py +341 -0
  159. py20305-0.1.0/tests/test_schedule_notifications.py +172 -0
  160. py20305-0.1.0/tests/test_schema_validation.py +166 -0
  161. py20305-0.1.0/tests/test_security_identity_proxied.py +37 -0
  162. py20305-0.1.0/tests/test_serialization.py +222 -0
  163. py20305-0.1.0/tests/test_smoke.py +7 -0
  164. py20305-0.1.0/tests/test_state.py +152 -0
  165. py20305-0.1.0/tests/test_subscription_integration.py +1246 -0
  166. py20305-0.1.0/tests/test_subscription_manager.py +980 -0
  167. py20305-0.1.0/tests/test_subscription_notification.py +913 -0
  168. py20305-0.1.0/tests/test_subscription_renewal.py +282 -0
  169. py20305-0.1.0/tests/test_tariff_events.py +111 -0
  170. py20305-0.1.0/tests/test_tariff_processor.py +369 -0
  171. py20305-0.1.0/tests/test_telemetry_der_availability.py +178 -0
  172. py20305-0.1.0/tests/test_telemetry_der_capability.py +277 -0
  173. py20305-0.1.0/tests/test_telemetry_der_settings.py +286 -0
  174. py20305-0.1.0/tests/test_telemetry_der_status.py +283 -0
  175. py20305-0.1.0/tests/test_telemetry_log_events.py +194 -0
  176. py20305-0.1.0/tests/test_telemetry_manager.py +1587 -0
  177. py20305-0.1.0/tests/test_telemetry_mup.py +829 -0
  178. py20305-0.1.0/tests/test_telemetry_scale_factor.py +354 -0
  179. py20305-0.1.0/tests/test_telemetry_scaling.py +201 -0
  180. py20305-0.1.0/tests/test_timebase.py +193 -0
  181. py20305-0.1.0/tests/test_tls.py +472 -0
  182. py20305-0.1.0/tests/test_tls_handshake.py +374 -0
  183. py20305-0.1.0/tests/test_traffic_recorder.py +98 -0
  184. py20305-0.1.0/tests/test_version_info.py +74 -0
py20305-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
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,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 DER Security Corp
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
py20305-0.1.0/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ py20305
2
+ Copyright 2026 DER Security Corp
3
+
4
+ This product includes software developed at DER Security Corp
5
+ (https://dersec.io).
py20305-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: py20305
3
+ Version: 0.1.0
4
+ Summary: An open IEEE 2030.5 / CSIP client for distributed energy resources
5
+ License-Expression: Apache-2.0
6
+ Keywords: ieee2030.5,csip,csip-aus,der,sunspec,modbus,smart-grid
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Topic :: System :: Networking
13
+ Requires-Python: >=3.11
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ License-File: NOTICE
17
+ Requires-Dist: aiohttp>=3.9
18
+ Requires-Dist: cryptography>=42.0
19
+ Requires-Dist: pydantic>=2.6
20
+ Requires-Dist: xsdata-pydantic>=24.0
21
+ Requires-Dist: lxml>=5.0
22
+ Provides-Extra: api
23
+ Requires-Dist: fastapi>=0.110; extra == "api"
24
+ Requires-Dist: uvicorn>=0.27; extra == "api"
25
+ Provides-Extra: cli
26
+ Requires-Dist: pyyaml>=6.0; extra == "cli"
27
+ Provides-Extra: sunspec
28
+ Requires-Dist: pysunspec2>=1.3.5; extra == "sunspec"
29
+ Requires-Dist: pyserial>=3.5; extra == "sunspec"
30
+ Provides-Extra: mqtt
31
+ Requires-Dist: aiomqtt>=2.0; extra == "mqtt"
32
+ Provides-Extra: all
33
+ Requires-Dist: py20305[api,cli,mqtt,sunspec]; extra == "all"
34
+ Provides-Extra: docs
35
+ Requires-Dist: mkdocs<2.0,>=1.6; extra == "docs"
36
+ Requires-Dist: mkdocs-material<10,>=9.5; extra == "docs"
37
+ Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
38
+ Provides-Extra: dev
39
+ Requires-Dist: py20305[all,docs]; extra == "dev"
40
+ Requires-Dist: ruff<0.16,>=0.4; extra == "dev"
41
+ Requires-Dist: mypy>=1.9; extra == "dev"
42
+ Requires-Dist: pytest>=8.0; extra == "dev"
43
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
44
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
45
+ Requires-Dist: pytest-aiohttp>=1.1; extra == "dev"
46
+ Requires-Dist: httpx>=0.27; extra == "dev"
47
+ Requires-Dist: lxml-stubs>=0.5; extra == "dev"
48
+ Requires-Dist: import-linter>=2.0; extra == "dev"
49
+ Requires-Dist: pre-commit>=3.7; extra == "dev"
50
+ Dynamic: license-file
51
+
52
+ <p align="center">
53
+ <picture>
54
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/satori-dark.png">
55
+ <img src="docs/assets/satori.png" alt="Satori" height="88">
56
+ </picture>
57
+ </p>
58
+
59
+ <p align="center">
60
+ <a href="https://lfenergy.org/"><picture>
61
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/lf-energy-white.png">
62
+ <img src="docs/assets/lf-energy-color.png" alt="LF Energy" height="32">
63
+ </picture></a>
64
+ &nbsp;&nbsp;&nbsp;&nbsp;
65
+ <a href="https://sunspec.org/"><img src="docs/assets/sunspec.png" alt="SunSpec Alliance" height="44"></a>
66
+ &nbsp;&nbsp;&nbsp;&nbsp;
67
+ <a href="https://dersec.io/"><picture>
68
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/dersec-white.png">
69
+ <img src="docs/assets/dersec-dark.png" alt="DER Security" height="32">
70
+ </picture></a>
71
+ </p>
72
+
73
+ # py20305
74
+
75
+ **The IEEE 2030.5 / CSIP client of [Project Satori](https://dersec.io/satori)** —
76
+ an LF Energy open-source project led by the SunSpec Alliance, DER Security,
77
+ and industry consortium members.
78
+
79
+ [![CI](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml/badge.svg)](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml)
80
+ [![Tests](.github/badges/tests.svg)](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml)
81
+ [![Coverage](.github/badges/coverage.svg)](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml)
82
+ [![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/)
83
+ [![License](https://img.shields.io/github/license/DERSecurity/py20305)](LICENSE)
84
+ [![Project Satori](https://img.shields.io/badge/Project-Satori-b7410e)](https://dersec.io/satori)
85
+
86
+ An open IEEE 2030.5 client for distributed energy resources, with CSIP-AUS
87
+ support. It speaks the utility's protocol so your device doesn't have to.
88
+
89
+ Point it at an IEEE 2030.5 server and it registers, discovers what the server
90
+ exposes, runs the DERControl schedule it is given, applies the resulting
91
+ setpoints to a device, and posts telemetry back.
92
+
93
+ ## Install
94
+
95
+ ```bash
96
+ pip install py20305
97
+ ```
98
+
99
+ The base install is the protocol client. Extras add what you may not need:
100
+ `sunspec` for Modbus devices, `api` for the HTTP management API, `mqtt` for
101
+ traffic forwarding, or `all`.
102
+
103
+ ## Running it as a service
104
+
105
+ ```bash
106
+ pip install "py20305[cli,sunspec]"
107
+ py20305 --config client.yaml --check # validate, print your LFDI
108
+ py20305 --config client.yaml # run
109
+ ```
110
+
111
+ One YAML or JSON file describes the server, the certificate and the devices. It
112
+ retries the connection while the server is down, registers itself only if the
113
+ server does not already know it, and stops cleanly on SIGTERM. See
114
+ [Running a client](https://dersecurity.github.io/py20305/running/)
115
+ and [`examples/client.example.yaml`](examples/client.example.yaml).
116
+
117
+ ## Running it in a container
118
+
119
+ ```bash
120
+ docker build -t py20305 .
121
+ docker run -d -v "$PWD/config:/etc/py20305:ro" py20305
122
+ ```
123
+
124
+ The image carries the client and nothing else -- configuration and certificates
125
+ are mounted, never baked in. It runs unprivileged and stops in order on
126
+ `SIGTERM`. See [Running in a container](https://dersecurity.github.io/py20305/docker/)
127
+ and [`examples/docker-compose.yml`](examples/docker-compose.yml).
128
+
129
+ ## Embedding it: talking to a server in five minutes
130
+
131
+ IEEE 2030.5 is mutual TLS throughout, and the server identifies your client by
132
+ its certificate. Your LFDI — the identifier the utility registers — is derived
133
+ from it:
134
+
135
+ ```python
136
+ from pathlib import Path
137
+ from py20305.security import compute_lfdi
138
+
139
+ print(compute_lfdi(Path("certs/client.pem").read_text()))
140
+ ```
141
+
142
+ Give that to whoever runs the server, then:
143
+
144
+ ```bash
145
+ python examples/quickstart.py \
146
+ --url https://server.example.com:8443 \
147
+ --cert certs/client.pem --key certs/client.key --ca certs/ca.pem
148
+ ```
149
+
150
+ That drives the print connector, which needs no hardware — it logs the controls
151
+ it would have applied. So you can exercise the whole discovery, event and
152
+ telemetry path against a real server before an inverter is wired up.
153
+
154
+ Swap in `SunSpecDeviceConfig` when you have one. Full walkthrough in the
155
+ [quickstart](https://dersecurity.github.io/py20305/quickstart/).
156
+
157
+ ## What's in it
158
+
159
+ | | |
160
+ |---|---|
161
+ | **Protocol client** | Discovery, registration, mTLS transport, retry with backoff, redirect probing, server timebase |
162
+ | **Event engine** | DERControl five-state machine, supersession across programs, randomized start and duration, `Response` acknowledgments |
163
+ | **Telemetry** | DERStatus, DERCapability, DERSettings, DERAvailability, metered readings as MirrorUsagePoints |
164
+ | **Connectors** | SunSpec Modbus over TCP, RTU and TLS; a no-hardware print connector; your own by subclass or factory |
165
+ | **Subscriptions** | Subscribe/notify as an alternative to polling, with a notification listener |
166
+ | **Runner** | A CLI, config file, connection retry and signal-handled shutdown |
167
+ | **Management API** | Optional HTTP API for observing and nudging a running client |
168
+ | **Forwarding** | Optional MQTT publication of every captured exchange |
169
+
170
+ ## Standards
171
+
172
+ **IEEE 2030.5-2018 and 2030.5-2023.** Both XSDs ship with the package and
173
+ validation runs against them. The generated bindings track 2023; a
174
+ `server_2018_compat` flag adjusts behavior for servers still on 2018.
175
+
176
+ **CSIP-AUS**, including DOE (dynamic operating envelope) limits.
177
+
178
+ The client maps one certificate identity to one end device. It registers and
179
+ drives that device, and does not fan a server-side EndDevice out across several
180
+ local ones.
181
+
182
+ ## Project Satori
183
+
184
+ *Any certified DER. Any utility program.* Satori — “awakening” — is an
185
+ open-source initiative to make any certified DER a compliant participant in
186
+ utility DER programs: point it at the Modbus port of a UL 1741 SB device —
187
+ inverter, battery, or EV — and it joins a program without a firmware rewrite.
188
+ The bundle builds on SunSpec-certified implementations contributed by
189
+ DER Security, and this repository is its IEEE 2030.5 half:
190
+
191
+ | Project | Role |
192
+ |---|---|
193
+ | [PySunSpec2](https://github.com/sunspec/pysunspec2) | SunSpec Modbus reference library, used in more than 80% of inverter-based products shipped globally |
194
+ | **py20305** (this repository) | IEEE 2030.5 client stack with CSIP and CSIP-AUS support, and a SunSpec Modbus bridge |
195
+ | SunSpec DevKit CE | Discover, read and identify SunSpec devices on the wire |
196
+
197
+ ## Documentation
198
+
199
+ <https://dersecurity.github.io/py20305/>
200
+
201
+ ## Development
202
+
203
+ ```bash
204
+ pip install -e ".[dev]"
205
+ pytest tests -q # unit tests, no network
206
+ ruff check src tests examples scripts
207
+ mypy
208
+ mkdocs serve # docs at http://127.0.0.1:8000
209
+ ```
210
+
211
+ There is also an end-to-end suite that runs this client against
212
+ [envoy](https://github.com/bsgip/envoy), the open-source CSIP-AUS utility
213
+ server from the Australian National University — the implementation ANU's
214
+ certification program runs on. It needs Docker:
215
+
216
+ ```bash
217
+ python scripts/e2e_server.py up
218
+ pytest tests/e2e -v
219
+ python scripts/e2e_server.py down
220
+ ```
221
+
222
+ The unit suite proves this client does what we believe the standard requires.
223
+ That one proves the belief survives contact with an implementation nobody here
224
+ wrote. See [Testing](https://dersecurity.github.io/py20305/testing/).
225
+
226
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
227
+
228
+ ## License
229
+
230
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
@@ -0,0 +1,179 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/satori-dark.png">
4
+ <img src="docs/assets/satori.png" alt="Satori" height="88">
5
+ </picture>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://lfenergy.org/"><picture>
10
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/lf-energy-white.png">
11
+ <img src="docs/assets/lf-energy-color.png" alt="LF Energy" height="32">
12
+ </picture></a>
13
+ &nbsp;&nbsp;&nbsp;&nbsp;
14
+ <a href="https://sunspec.org/"><img src="docs/assets/sunspec.png" alt="SunSpec Alliance" height="44"></a>
15
+ &nbsp;&nbsp;&nbsp;&nbsp;
16
+ <a href="https://dersec.io/"><picture>
17
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/dersec-white.png">
18
+ <img src="docs/assets/dersec-dark.png" alt="DER Security" height="32">
19
+ </picture></a>
20
+ </p>
21
+
22
+ # py20305
23
+
24
+ **The IEEE 2030.5 / CSIP client of [Project Satori](https://dersec.io/satori)** —
25
+ an LF Energy open-source project led by the SunSpec Alliance, DER Security,
26
+ and industry consortium members.
27
+
28
+ [![CI](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml/badge.svg)](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml)
29
+ [![Tests](.github/badges/tests.svg)](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml)
30
+ [![Coverage](.github/badges/coverage.svg)](https://github.com/DERSecurity/py20305/actions/workflows/ci.yml)
31
+ [![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/)
32
+ [![License](https://img.shields.io/github/license/DERSecurity/py20305)](LICENSE)
33
+ [![Project Satori](https://img.shields.io/badge/Project-Satori-b7410e)](https://dersec.io/satori)
34
+
35
+ An open IEEE 2030.5 client for distributed energy resources, with CSIP-AUS
36
+ support. It speaks the utility's protocol so your device doesn't have to.
37
+
38
+ Point it at an IEEE 2030.5 server and it registers, discovers what the server
39
+ exposes, runs the DERControl schedule it is given, applies the resulting
40
+ setpoints to a device, and posts telemetry back.
41
+
42
+ ## Install
43
+
44
+ ```bash
45
+ pip install py20305
46
+ ```
47
+
48
+ The base install is the protocol client. Extras add what you may not need:
49
+ `sunspec` for Modbus devices, `api` for the HTTP management API, `mqtt` for
50
+ traffic forwarding, or `all`.
51
+
52
+ ## Running it as a service
53
+
54
+ ```bash
55
+ pip install "py20305[cli,sunspec]"
56
+ py20305 --config client.yaml --check # validate, print your LFDI
57
+ py20305 --config client.yaml # run
58
+ ```
59
+
60
+ One YAML or JSON file describes the server, the certificate and the devices. It
61
+ retries the connection while the server is down, registers itself only if the
62
+ server does not already know it, and stops cleanly on SIGTERM. See
63
+ [Running a client](https://dersecurity.github.io/py20305/running/)
64
+ and [`examples/client.example.yaml`](examples/client.example.yaml).
65
+
66
+ ## Running it in a container
67
+
68
+ ```bash
69
+ docker build -t py20305 .
70
+ docker run -d -v "$PWD/config:/etc/py20305:ro" py20305
71
+ ```
72
+
73
+ The image carries the client and nothing else -- configuration and certificates
74
+ are mounted, never baked in. It runs unprivileged and stops in order on
75
+ `SIGTERM`. See [Running in a container](https://dersecurity.github.io/py20305/docker/)
76
+ and [`examples/docker-compose.yml`](examples/docker-compose.yml).
77
+
78
+ ## Embedding it: talking to a server in five minutes
79
+
80
+ IEEE 2030.5 is mutual TLS throughout, and the server identifies your client by
81
+ its certificate. Your LFDI — the identifier the utility registers — is derived
82
+ from it:
83
+
84
+ ```python
85
+ from pathlib import Path
86
+ from py20305.security import compute_lfdi
87
+
88
+ print(compute_lfdi(Path("certs/client.pem").read_text()))
89
+ ```
90
+
91
+ Give that to whoever runs the server, then:
92
+
93
+ ```bash
94
+ python examples/quickstart.py \
95
+ --url https://server.example.com:8443 \
96
+ --cert certs/client.pem --key certs/client.key --ca certs/ca.pem
97
+ ```
98
+
99
+ That drives the print connector, which needs no hardware — it logs the controls
100
+ it would have applied. So you can exercise the whole discovery, event and
101
+ telemetry path against a real server before an inverter is wired up.
102
+
103
+ Swap in `SunSpecDeviceConfig` when you have one. Full walkthrough in the
104
+ [quickstart](https://dersecurity.github.io/py20305/quickstart/).
105
+
106
+ ## What's in it
107
+
108
+ | | |
109
+ |---|---|
110
+ | **Protocol client** | Discovery, registration, mTLS transport, retry with backoff, redirect probing, server timebase |
111
+ | **Event engine** | DERControl five-state machine, supersession across programs, randomized start and duration, `Response` acknowledgments |
112
+ | **Telemetry** | DERStatus, DERCapability, DERSettings, DERAvailability, metered readings as MirrorUsagePoints |
113
+ | **Connectors** | SunSpec Modbus over TCP, RTU and TLS; a no-hardware print connector; your own by subclass or factory |
114
+ | **Subscriptions** | Subscribe/notify as an alternative to polling, with a notification listener |
115
+ | **Runner** | A CLI, config file, connection retry and signal-handled shutdown |
116
+ | **Management API** | Optional HTTP API for observing and nudging a running client |
117
+ | **Forwarding** | Optional MQTT publication of every captured exchange |
118
+
119
+ ## Standards
120
+
121
+ **IEEE 2030.5-2018 and 2030.5-2023.** Both XSDs ship with the package and
122
+ validation runs against them. The generated bindings track 2023; a
123
+ `server_2018_compat` flag adjusts behavior for servers still on 2018.
124
+
125
+ **CSIP-AUS**, including DOE (dynamic operating envelope) limits.
126
+
127
+ The client maps one certificate identity to one end device. It registers and
128
+ drives that device, and does not fan a server-side EndDevice out across several
129
+ local ones.
130
+
131
+ ## Project Satori
132
+
133
+ *Any certified DER. Any utility program.* Satori — “awakening” — is an
134
+ open-source initiative to make any certified DER a compliant participant in
135
+ utility DER programs: point it at the Modbus port of a UL 1741 SB device —
136
+ inverter, battery, or EV — and it joins a program without a firmware rewrite.
137
+ The bundle builds on SunSpec-certified implementations contributed by
138
+ DER Security, and this repository is its IEEE 2030.5 half:
139
+
140
+ | Project | Role |
141
+ |---|---|
142
+ | [PySunSpec2](https://github.com/sunspec/pysunspec2) | SunSpec Modbus reference library, used in more than 80% of inverter-based products shipped globally |
143
+ | **py20305** (this repository) | IEEE 2030.5 client stack with CSIP and CSIP-AUS support, and a SunSpec Modbus bridge |
144
+ | SunSpec DevKit CE | Discover, read and identify SunSpec devices on the wire |
145
+
146
+ ## Documentation
147
+
148
+ <https://dersecurity.github.io/py20305/>
149
+
150
+ ## Development
151
+
152
+ ```bash
153
+ pip install -e ".[dev]"
154
+ pytest tests -q # unit tests, no network
155
+ ruff check src tests examples scripts
156
+ mypy
157
+ mkdocs serve # docs at http://127.0.0.1:8000
158
+ ```
159
+
160
+ There is also an end-to-end suite that runs this client against
161
+ [envoy](https://github.com/bsgip/envoy), the open-source CSIP-AUS utility
162
+ server from the Australian National University — the implementation ANU's
163
+ certification program runs on. It needs Docker:
164
+
165
+ ```bash
166
+ python scripts/e2e_server.py up
167
+ pytest tests/e2e -v
168
+ python scripts/e2e_server.py down
169
+ ```
170
+
171
+ The unit suite proves this client does what we believe the standard requires.
172
+ That one proves the belief survives contact with an implementation nobody here
173
+ wrote. See [Testing](https://dersecurity.github.io/py20305/testing/).
174
+
175
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
176
+
177
+ ## License
178
+
179
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).