openadr3-client-gac-compliance 1.0.0__py3-none-any.whl → 1.1.0__py3-none-any.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.
- openadr3_client_gac_compliance/__init__.py +1 -0
- openadr3_client_gac_compliance/gac20/ven_gac_compliant.py +27 -0
- {openadr3_client_gac_compliance-1.0.0.dist-info → openadr3_client_gac_compliance-1.1.0.dist-info}/METADATA +2 -1
- {openadr3_client_gac_compliance-1.0.0.dist-info → openadr3_client_gac_compliance-1.1.0.dist-info}/RECORD +6 -5
- {openadr3_client_gac_compliance-1.0.0.dist-info → openadr3_client_gac_compliance-1.1.0.dist-info}/LICENSE.md +0 -0
- {openadr3_client_gac_compliance-1.0.0.dist-info → openadr3_client_gac_compliance-1.1.0.dist-info}/WHEEL +0 -0
|
@@ -3,3 +3,4 @@ from openadr3_client_gac_compliance.config import GAC_VERSION
|
|
|
3
3
|
if GAC_VERSION == "2.0":
|
|
4
4
|
import openadr3_client_gac_compliance.gac20.program_gac_compliant # noqa: F401
|
|
5
5
|
import openadr3_client_gac_compliance.gac20.event_gac_compliant # noqa: F401
|
|
6
|
+
import openadr3_client_gac_compliance.gac20.ven_gac_compliant # noqa: F401
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from openadr3_client.models.model import ValidatorRegistry, Model as ValidatorModel
|
|
3
|
+
from openadr3_client.models.ven.ven import Ven
|
|
4
|
+
import pycountry
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@ValidatorRegistry.register(Ven, ValidatorModel())
|
|
8
|
+
def ven_gac_compliant(self: Ven) -> Ven:
|
|
9
|
+
"""Enforces that the ven is GAC compliant.
|
|
10
|
+
|
|
11
|
+
GAC enforces the following constraints for vens:
|
|
12
|
+
- The ven must have a ven name
|
|
13
|
+
- The ven name must be an eMI3 identifier.
|
|
14
|
+
"""
|
|
15
|
+
emi3_identifier_regex = r"^[A-Z]{2}-?[A-Z0-9]{3}$"
|
|
16
|
+
|
|
17
|
+
if not re.fullmatch(emi3_identifier_regex, self.ven_name):
|
|
18
|
+
raise ValueError("The ven name must be formatted as an eMI3 identifier.")
|
|
19
|
+
|
|
20
|
+
alpha_2_country = pycountry.countries.get(alpha_2=self.ven_name[:2])
|
|
21
|
+
|
|
22
|
+
if alpha_2_country is None:
|
|
23
|
+
raise ValueError(
|
|
24
|
+
"The first two characters of the ven name must be a valid ISO 3166-1 alpha-2 country code."
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
return self
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: openadr3-client-gac-compliance
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Nick van der Burgt
|
|
6
6
|
Author-email: nick.van.der.burgt@elaad.nl
|
|
@@ -9,6 +9,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.12
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.13
|
|
11
11
|
Requires-Dist: openadr3-client (>=0.0.1,<0.0.2)
|
|
12
|
+
Requires-Dist: pycountry (>=24.6.1,<25.0.0)
|
|
12
13
|
Requires-Dist: pydantic (>=2.11.2,<3.0.0)
|
|
13
14
|
Description-Content-Type: text/markdown
|
|
14
15
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
openadr3_client_gac_compliance/__init__.py,sha256=
|
|
1
|
+
openadr3_client_gac_compliance/__init__.py,sha256=dzf9YdOlssEb9GSIoThaMzEJ956G-hpLi7HIXRC3TR8,334
|
|
2
2
|
openadr3_client_gac_compliance/config.py,sha256=X_KEl99bUm05rH0IOKLyeR4Zn2utdC8U3vLkdG8MYXU,675
|
|
3
3
|
openadr3_client_gac_compliance/gac20/__init__.py,sha256=YPjRHMl-uR6ZwrDGjY_EboScHe_VhTrovso_zDOSd6o,220
|
|
4
4
|
openadr3_client_gac_compliance/gac20/event_gac_compliant.py,sha256=KPcUyazlroFv0c3IovvtMW4a4LD2lBOyct4ptjngixk,7970
|
|
5
5
|
openadr3_client_gac_compliance/gac20/program_gac_compliant.py,sha256=qJeyvAdu0f6F0I3iXXl64dOVRZwPfRHQyGqc3ECuzjw,1725
|
|
6
|
+
openadr3_client_gac_compliance/gac20/ven_gac_compliant.py,sha256=YAzM2Q9ggh_O-p1xD5GlN7-lTGg2MjqUG26KBSy3-d8,908
|
|
6
7
|
openadr3_client_gac_compliance/gac21/__init__.py,sha256=GTu1EyBj2T72zT3MKPettcvP-DNCJ0p6oAMj3Z-08N0,61
|
|
7
|
-
openadr3_client_gac_compliance-1.
|
|
8
|
-
openadr3_client_gac_compliance-1.
|
|
9
|
-
openadr3_client_gac_compliance-1.
|
|
10
|
-
openadr3_client_gac_compliance-1.
|
|
8
|
+
openadr3_client_gac_compliance-1.1.0.dist-info/LICENSE.md,sha256=NNNxKzhSK6afX-UaN8WZIVtMi5Tu8dVr6q3ciTSnH-g,10250
|
|
9
|
+
openadr3_client_gac_compliance-1.1.0.dist-info/METADATA,sha256=tuuieVH5mgB1rE9ijxwSyt3zSFzvB4zqEwsw98WLA-s,1096
|
|
10
|
+
openadr3_client_gac_compliance-1.1.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
11
|
+
openadr3_client_gac_compliance-1.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|