|
1 | 1 | # Python bindings for the EML_NL Standard
|
2 |
| -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 staticically checked using [mypy](https://mypy-lang.org/) or [pyright](https://github.com/microsoft/pyright). |
| 2 | +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). |
3 | 3 |
|
4 | 4 | ## Requirements
|
5 |
| -- 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 (see [here](https://xsdata.readthedocs.io/en/latest/faq/why-non-nullable-fields-are-marked-as-optional.html)). |
6 |
| -- [xsData](https://github.com/tefra/xsdata) for parsing using these databindings. |
| 5 | +- 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)). |
| 6 | +- [xsData](https://github.com/tefra/xsdata) for parsing using these data bindings. |
| 7 | + |
| 8 | +For running tests, additionally: |
| 9 | +- [pytest](https://docs.pytest.org/) for the test framework. |
| 10 | +- [formencode](http://www.formencode.org/) for XML comparison. |
7 | 11 |
|
8 | 12 | ## Testing
|
9 |
| -The bindings are tested on over 2500 different EML files from different type of Dutch elections, all downloaded from [data.overheid.nl](https://data.overheid.nl/community/organization/kiesraad) using a roundtrip serialization test. |
| 13 | +The bindings are tested on over 2500 different EML files from different type of Dutch elections, all downloaded from [data.overheid.nl](https://data.overheid.nl/community/organization/kiesraad) using a roundtrip serialization test. To run the tests, install the test dependencies (see above), put EML files into a `data` folder and run `pytest` in the root folder. |
10 | 14 |
|
11 | 15 | See the [test report](pyeml_bindings_testreport.html)
|
12 | 16 |
|
@@ -43,7 +47,6 @@ with open(Path("output.xml"), "w") as out_file:
|
43 | 47 | # to use the same namespace prefixes.
|
44 | 48 | # If we don't, we still get back valid EML but with ns0, ns1 etc.
|
45 | 49 | serializer.write(out=out_file, obj=eml, ns_map=NAMESPACE)
|
46 |
| - |
47 | 50 | ```
|
48 | 51 |
|
49 | 52 | ## Building
|
|
0 commit comments