OpenADR3 client
This repository contains a plugin for the OpenADR3-client library that adds additional Pydantic validators to the OpenADR3 domain models to ensure compliance with the OpenADR DER profile specification, the Dutch DSO to aggregator interface. Since compliance with the profile is a superset of OpenADR3, adding validation rules on top of the OpenADR3 models is sufficient to ensure compliance.
Registering the plugin is done using the global ValidatorPluginRegistry class:
from openadr3_client.plugin import ValidatorPluginRegistry
from openadr3_client_nlflex_compliance.nlflex11.plugin import Nlflex11ValidatorPlugin
ValidatorPluginRegistry.register_plugin(Nlflex11ValidatorPlugin.setup())
Nlflex10ValidatorPlugin from openadr3_client_nlflex_compliance.nlflex10.plugin is registered the same way.
Version support
The package provides a validator implementation per version of the profile specification, in a subpackage named for that version:
- Nlflex11ValidatorPlugin (
nlflex11): OpenADR DER profile specification v1.1.0 - Nlflex10ValidatorPlugin (
nlflex10): OpenADR DER profile specification v1.0.0
Register the plugin for the version of the specification you implement. An earlier plugin, Nlflex01ValidatorPlugin, validated the unreleased NL-Flex v0.1 draft and has been removed: the released v1.0.0 contradicts that draft on several rules rather than only extending it.
Raw-input checks (nlflex11)
"Timestamps and durations" of the v1.1.0 profile forbids days in durations (P1D, use PT24H) and requires timestamps in UTC with the Z notation. The parser is more lenient: P1D and PT24H become the same timedelta, Z and +01:00 are both accepted and normalised to aware datetimes, and plain numbers are accepted too. These rules therefore cannot be checked on the parsed model, where the plugin validators run. Run the raw-input functions on the raw JSON before parsing it, and raise or report their errors:
from pydantic import ValidationError
from openadr3_client_nlflex_compliance.nlflex11 import validate_raw_event
raw_event = response.json() # the dict as returned by the VTN, not yet parsed
errors = validate_raw_event(raw_event)
if errors:
raise ValidationError.from_exception_data("Event", errors)
validate_raw_program, validate_raw_report, validate_raw_ven, validate_raw_resource and validate_raw_resource_group work the same way. They are deliberately not registered in the plugin.
Accepted versions (nlflex11)
A program must advertise version 1.1.z in its PROGRAM_TYPE (DER_REGISTRATION_INTERFACE-1.1.z or DER_DISPATCH_INTERFACE-1.1.z). Any patch, and a pre-release or build of it such as 1.1.0-rc.1, is accepted; a later minor or major version is not. Because patches are accepted, the registration program and a dispatch program can each pass on their own while advertising different patch versions, which validate_programs_lock_step below catches.
Checks across objects (nlflex11)
The plugin sees one object at a time, so rules that compare objects are not registered. A caller that holds both objects runs them itself:
validate_event_program_ownership(event, program)checks that an event lives in the kind of program that owns its kind of event (registration or dispatch).validate_programs_lock_step(programs)checks that the registration program and every dispatch program advertise the same 1.1.z version. The registration and dispatch programs currently live on separate VTN deployments, so pass the programs from both.validate_flex_dispatch_event_compliant(event, max_duration=..., max_callable_kw=...)takes theMAX_DURATIONandACTIVE_AVAILABLE_FLEXof the targeted resource group as keyword-only arguments and checks the dispatch intervals against them.validate_flex_delivery_report_compliant(report, event_intervals=...)takes the intervals of the FLEX event as a keyword-only argument and checks that the delivery report has one matching interval per event interval.
validate_event_program_ownership and validate_programs_lock_step return a list of errors, empty when compliant. validate_flex_dispatch_event_compliant and validate_flex_delivery_report_compliant return a list of errors, or None when compliant. Raise or report the errors the same way as above.
License
This project is licensed under the Apache-2.0 - see LICENSE for details.
Licenses third-party libraries
This project includes third-party libraries, which are licensed under their own respective Open-Source licenses. SPDX-License-Identifier headers are used to show which license is applicable. The concerning license files can be found in the LICENSES directory.
About ElaadNL
ElaadNL is a Dutch research institute founded and funded by the Dutch District Service Operators (DSOs). ElaadNL was originally tasked by the DSOs to kickstart and foster the adoption of Electric Vehicles by installing the first Dutch charging stations, as well as monitoring the effects EVs have on the grid.
A major result of this pioneering work, was the creation of the Open Charge Point Protocol (OCPP), which today is the de-facto standard for CPOs to communicate with and manage their chargepoints. The protocol is now managed in a spin-off organization: the Open Charge Alliance, which is still closely connected with ElaadNL.
Whereas ElaadNL initially focused mainly on EVs, it has now expanded its mandate to include residential energy use with the goal of increasing the adoption of demand response measures. The reason for this move is to improve efficient use of the resources of the DSO in order to reduce grid congestion, which is a major problem challenge for the Dutch DSOs as well as society as a whole.
Metadata
Release files for openadr3-client-nlflex-compliance 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openadr3_client_nlflex_compliance-0.3.0.tar.gz | 63.5 kB | With provenance | Details for openadr3_client_nlflex_compliance-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openadr3_client_nlflex_compliance-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for openadr3_client_nlflex_compliance-0.3.0-py3-none-any.whl |
Total release size: 138.8 kB
Release files / openadr3_client_nlflex_compliance-0.3.0.tar.gz
| Download URL | openadr3_client_nlflex_compliance-0.3.0.tar.gz |
|---|---|
| Size | 63.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77cc9de30576c53e440c186b2152231717c93d0f4ac67e279a635c55a2c3aa42
|
|
BLAKE2b-256 checksum How to use checksums |
008291a04f14bc5ddc2b99fc447d4fd5e27848c9d561398218569d186a561a53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / openadr3_client_nlflex_compliance-0.3.0-py3-none-any.whl
| Download URL | openadr3_client_nlflex_compliance-0.3.0-py3-none-any.whl |
|---|---|
| Size | 75.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90799f2825e43bf465d52370871a7a219d83d45ae05660ac3e3e012c95b3e0ab
|
|
BLAKE2b-256 checksum How to use checksums |
7b9743332378b070834313770502c7ed37b10367d4cc116d6866224eb3f3f834
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for openadr3-client-nlflex-compliance 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for openadr3_client_nlflex_compliance-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.