Skip to content

Commit 6192947

Browse files
authored
Implements changes made in EML_NL v1.3.0 (#7)
* Generate new dataclasses for EML_NL v1.3 * Update init file * Bump version and change testfiles link * Make Emlstructure[ddd] inherit from both the base EML structure and the KR Emlstructure * Don't write default attributes and make maxvotes default to none Even though officially the standard (OASIS) specifies that this value should be serialized as '1', in practice this is used to denote the absence of this value * Update readme and bump xsdata version
1 parent d11a8a7 commit 6192947

21 files changed

Lines changed: 4395 additions & 2973 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Data bindings for the EML_NL Standard to load EML_NL files into Python [dataclasses](https://docs.python.org/3/library/dataclasses.html) with correct structure, datatypes and typehints following the [EML_NL Xml Schema Definitions](https://www.kiesraad.nl/adviezen-en-publicaties/formulieren/2016/osv/eml-bestanden/eml_nl_1_2_1-xsd). Type hints can be statically checked using [mypy](https://mypy-lang.org/) or [pyright](https://github.com/microsoft/pyright).
88

99
## Requirements
10-
- At least Python version 3.10 for the [KW_ONLY](https://docs.python.org/3/library/dataclasses.html#dataclasses.KW_ONLY) type annotations for dataclasses. This is so that non-nullable fields can be marked as mandatory (refer to [xsdata documentation](https://xsdata.readthedocs.io/en/latest/faq/why-non-nullable-fields-are-marked-as-optional.html)).
10+
- At least Python version 3.10
1111
- [xsData](https://github.com/tefra/xsdata) for parsing using these data bindings.
1212

1313
For running tests, additionally:

pyeml_bindings/__init__.py

Lines changed: 84 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""This file was generated by xsdata, v23.8, on 2023-10-17 11:34:35
2-
3-
Generator: DataclassGenerator
4-
See: https://xsdata.readthedocs.io/
5-
"""
6-
71
from pyeml_bindings.converters.xml_date_time import FullPrecisionXmlDateTimeConverter
82
from pyeml_bindings.emlcore_kiesraad_strict import (
93
Accepted,
@@ -105,6 +99,7 @@
10599
ResponsibleOfficerStructure,
106100
ResultsReportedStructure,
107101
ScrutinyRequirement,
102+
ScrutinyRequirementStructure,
108103
Seal,
109104
SealStructure,
110105
SequenceNumber,
@@ -150,6 +145,8 @@
150145
CommitteeCategoryType,
151146
Contest,
152147
Contests,
148+
CountingMethod,
149+
CountingMethodMethodCode,
153150
CreatedByAuthority,
154151
CreationDateTime,
155152
DateOfBirthAnnex,
@@ -159,12 +156,22 @@
159156
ElectionSubcategory,
160157
ElectionSubcategoryType,
161158
ElectionTree,
159+
GenderAnnex,
160+
GenderAnnexValue,
161+
InitialCast,
162+
InitialRejectedVotes,
163+
InitialTotalCounted,
164+
InitialUncountedVotes,
165+
InitialValidVotes,
166+
InvestigationReasonCode,
162167
ListData,
163168
LivingAddress,
164169
LivingAddressType,
165170
NationalIdentificationNumber,
166171
NominationDate,
167172
NumberOfSeats,
173+
Phase,
174+
PhasePhaseCode,
168175
PreferenceThreshold,
169176
PublicationLanguageType,
170177
Region,
@@ -174,7 +181,15 @@
174181
RegisteredBy,
175182
RegisteredParties,
176183
RegisteredParty,
184+
RejectedVotesType,
185+
RejectedVotesTypeReasonCode,
177186
ReportingUnitInvestigations,
187+
ReportingUnitType,
188+
ReportingUnitTypeValue,
189+
Schema,
190+
SharedLocation,
191+
UncountedVotesType,
192+
UncountedVotesTypeReasonCode,
178193
)
179194
from pyeml_bindings.kiesraad_eml_restrictions import (
180195
AddressStructureRestrictedKr,
@@ -197,6 +212,15 @@
197212
QualifyingAddressStructureKr,
198213
ReportingUnitIdentifierStructureKr,
199214
)
215+
from pyeml_bindings.kiesraad_eml_sb_extensions import (
216+
AccessibilityPropertiesType,
217+
AccessibilityPropertiesTypeGuidelines,
218+
AccessibilityPropertiesTypeSignLanguageInterpreter,
219+
BuildingUsageType,
220+
Location,
221+
MunicipalityContactDetails,
222+
MunicipalityElectionSite,
223+
)
200224
from pyeml_bindings.mod_110a_electionevent_kiesraad_strict import (
201225
ContestIdentifierStructure110A,
202226
ElectionEvent,
@@ -240,9 +264,7 @@
240264
Count,
241265
ElectionIdentifierStructure510,
242266
Emlstructure510,
243-
RejectedVotesReasonCode,
244267
ReportingUnitVotes,
245-
UncountedVotesReasonCode,
246268
)
247269
from pyeml_bindings.mod_510_count_kiesraad_strict import (
248270
Eml as Eml510,
@@ -259,6 +281,17 @@
259281
from pyeml_bindings.mod_520_result_kiesraad_strict import (
260282
Eml as Eml520,
261283
)
284+
from pyeml_bindings.mod_630_optionslist_kiesraad_strict import (
285+
ElectionIdentifierStructure630,
286+
Emlstructure630,
287+
OptionsList,
288+
ProposalIdentifierStructure630,
289+
ProposalStructure630,
290+
ReferendumOptionIdentifierStructure630,
291+
)
292+
from pyeml_bindings.mod_630_optionslist_kiesraad_strict import (
293+
Eml as Eml630,
294+
)
262295
from pyeml_bindings.x_al_kiesraad_strict import (
263296
Address,
264297
AddressDetails,
@@ -438,6 +471,7 @@
438471
"ResponsibleOfficerStructure",
439472
"ResultsReportedStructure",
440473
"ScrutinyRequirement",
474+
"ScrutinyRequirementStructure",
441475
"Seal",
442476
"SealStructure",
443477
"SequenceNumber",
@@ -476,6 +510,8 @@
476510
"CommitteeCategoryType",
477511
"Contest",
478512
"Contests",
513+
"CountingMethod",
514+
"CountingMethodMethodCode",
479515
"CreatedByAuthority",
480516
"CreationDateTime",
481517
"DateOfBirthAnnex",
@@ -485,12 +521,22 @@
485521
"ElectionSubcategory",
486522
"ElectionSubcategoryType",
487523
"ElectionTree",
524+
"GenderAnnex",
525+
"GenderAnnexValue",
526+
"InitialCast",
527+
"InitialRejectedVotes",
528+
"InitialTotalCounted",
529+
"InitialUncountedVotes",
530+
"InitialValidVotes",
531+
"InvestigationReasonCode",
488532
"ListData",
489533
"LivingAddress",
490534
"LivingAddressType",
491535
"NationalIdentificationNumber",
492536
"NominationDate",
493537
"NumberOfSeats",
538+
"Phase",
539+
"PhasePhaseCode",
494540
"PreferenceThreshold",
495541
"PublicationLanguageType",
496542
"Region",
@@ -500,6 +546,15 @@
500546
"RegisteredBy",
501547
"RegisteredParties",
502548
"RegisteredParty",
549+
"RejectedVotesType",
550+
"RejectedVotesTypeReasonCode",
551+
"ReportingUnitInvestigations",
552+
"ReportingUnitType",
553+
"ReportingUnitTypeValue",
554+
"Schema",
555+
"SharedLocation",
556+
"UncountedVotesType",
557+
"UncountedVotesTypeReasonCode",
503558
"AddressStructureRestrictedKr",
504559
"AffiliationIdentifierStructureKr",
505560
"AffiliationStructureKr",
@@ -519,6 +574,20 @@
519574
"MinimalQualifyingAddressStructureKr",
520575
"QualifyingAddressStructureKr",
521576
"ReportingUnitIdentifierStructureKr",
577+
"AccessibilityPropertiesType",
578+
"AccessibilityPropertiesTypeGuidelines",
579+
"AccessibilityPropertiesTypeSignLanguageInterpreter",
580+
"BuildingUsageType",
581+
"Location",
582+
"MunicipalityContactDetails",
583+
"MunicipalityElectionSite",
584+
"ContestIdentifierStructure110A",
585+
"Emlstructure110",
586+
"Eml110a",
587+
"ElectionEvent",
588+
"ElectionIdentifierStructure110A",
589+
"PollingPlaceStructure110",
590+
"PollingPlaceStructure110Channel",
522591
"AffiliationIdentifierStructure210",
523592
"AffiliationStructure210",
524593
"CandidateIdentifierStructure210",
@@ -543,9 +612,7 @@
543612
"Emlstructure510",
544613
"Eml510",
545614
"ElectionIdentifierStructure510",
546-
"RejectedVotesReasonCode",
547615
"ReportingUnitVotes",
548-
"UncountedVotesReasonCode",
549616
"AffiliationIdentifierStructure520",
550617
"CandidateIdentifierStructure520",
551618
"CandidateStructure520",
@@ -554,6 +621,13 @@
554621
"ElectionIdentifierStructure520",
555622
"Result",
556623
"SelectionRanking",
624+
"Emlstructure630",
625+
"Eml630",
626+
"ElectionIdentifierStructure630",
627+
"OptionsList",
628+
"ProposalIdentifierStructure630",
629+
"ProposalStructure630",
630+
"ReferendumOptionIdentifierStructure630",
557631
"Address",
558632
"AddressDetails",
559633
"AddressLine",
@@ -625,14 +699,6 @@
625699
"OrganisationNameDetails1",
626700
"XNlPersonName",
627701
"XNl",
628-
"ContestIdentifierStructure110A",
629-
"Emlstructure110",
630-
"Eml110a",
631-
"ElectionEvent",
632-
"ElectionIdentifierStructure110A",
633-
"PollingPlaceStructure110",
634-
"PollingPlaceStructure110Channel",
635-
"ReportingUnitInvestigations",
636702
]
637703

638704
# Register custom converters for serialization

0 commit comments

Comments
 (0)