xml-auditfile 0.0.1__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.
- xml_auditfile-0.0.1/.gitignore +11 -0
- xml_auditfile-0.0.1/CHANGELOG.md +32 -0
- xml_auditfile-0.0.1/LICENSE +201 -0
- xml_auditfile-0.0.1/PKG-INFO +256 -0
- xml_auditfile-0.0.1/README.md +230 -0
- xml_auditfile-0.0.1/pyproject.toml +43 -0
- xml_auditfile-0.0.1/spec.lock.json +5 -0
- xml_auditfile-0.0.1/src/xml_auditfile/__init__.py +88 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_checks.py +279 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_decimal.py +44 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_frames.py +147 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_json.py +92 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_keys.py +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_resources.py +55 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_session.py +756 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/diagnostics.json +735 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/registry.json +310 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/spec.json +1 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaa/3_2/auditfile.xsd +1147 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaa/3_2/definition.json +2800 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaa/3_2/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaa/3_2/iso3166_20170327.xsd +260 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaa/3_2/iso4217_20170327.xsd +199 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaa/3_2/manifest.json +2407 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xab/1_0/auditfile.xsd +1457 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xab/1_0/definition.json +3676 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xab/1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xab/1_0/manifest.json +3378 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/3_2/auditfile.xsd +1183 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/3_2/definition.json +3443 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/3_2/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/3_2/manifest.json +2706 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/4_0_3/auditfile.xsd +349 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/4_0_3/definition.json +1342 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/4_0_3/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xaf/4_0_3/manifest.json +960 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/1_2/auditfile.xsd +1147 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/1_2/definition.json +3709 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/1_2/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/1_2/manifest.json +2306 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/2_3_6_1/auditfile.xsd +761 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/2_3_6_1/definition.json +4019 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/2_3_6_1/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xar/2_3_6_1/manifest.json +2091 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2018_1_0/auditfile.xsd +1680 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2018_1_0/definition.json +3441 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2018_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2018_1_0/manifest.json +1573 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2019_1_0/auditfile.xsd +1688 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2019_1_0/definition.json +3079 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2019_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2019_1_0/manifest.json +1573 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2020_1_0/auditfile.xsd +1503 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2020_1_0/definition.json +3301 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2020_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2020_1_0/manifest.json +1618 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2021_1_1/auditfile.xsd +1513 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2021_1_1/definition.json +3309 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2021_1_1/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2021_1_1/manifest.json +1618 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2022_1_1/auditfile.xsd +987 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2022_1_1/definition.json +3389 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2022_1_1/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2022_1_1/manifest.json +1663 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2023_1_0/auditfile.xsd +1486 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2023_1_0/definition.json +3427 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2023_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2023_1_0/manifest.json +1681 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2024_1_0/auditfile.xsd +1598 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2024_1_0/definition.json +3525 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2024_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2024_1_0/manifest.json +1681 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2025_1_0/auditfile.xsd +1534 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2025_1_0/definition.json +3525 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2025_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2025_1_0/manifest.json +1681 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2026_1_0/auditfile.xsd +1544 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2026_1_0/definition.json +3533 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2026_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2026_1_0/manifest.json +1681 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2027_1_0/auditfile.xsd +1550 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2027_1_0/definition.json +3523 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2027_1_0/dialects.json +4 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/standards/xas/2027_1_0/manifest.json +1681 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/views/xaf.json +1075 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_spec/views/xas.json +407 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_streams.py +240 -0
- xml_auditfile-0.0.1/src/xml_auditfile/_xml.py +242 -0
- xml_auditfile-0.0.1/src/xml_auditfile/auditfile.py +196 -0
- xml_auditfile-0.0.1/src/xml_auditfile/custom.py +187 -0
- xml_auditfile-0.0.1/src/xml_auditfile/definitions.py +460 -0
- xml_auditfile-0.0.1/src/xml_auditfile/diagnostics.py +237 -0
- xml_auditfile-0.0.1/src/xml_auditfile/memory.py +103 -0
- xml_auditfile-0.0.1/src/xml_auditfile/options.py +132 -0
- xml_auditfile-0.0.1/src/xml_auditfile/py.typed +0 -0
- xml_auditfile-0.0.1/src/xml_auditfile/rows.py +116 -0
- xml_auditfile-0.0.1/src/xml_auditfile/schema.py +280 -0
- xml_auditfile-0.0.1/src/xml_auditfile/sinks.py +82 -0
- xml_auditfile-0.0.1/src/xml_auditfile/source.py +136 -0
- xml_auditfile-0.0.1/src/xml_auditfile/values.py +124 -0
- xml_auditfile-0.0.1/src/xml_auditfile/versions.py +312 -0
- xml_auditfile-0.0.1/src/xml_auditfile/views.py +521 -0
- xml_auditfile-0.0.1/src/xml_auditfile/xsd/__init__.py +6 -0
- xml_auditfile-0.0.1/src/xml_auditfile/xsd/_datatypes.py +147 -0
- xml_auditfile-0.0.1/src/xml_auditfile/xsd/_regex.py +79 -0
- xml_auditfile-0.0.1/src/xml_auditfile/xsd/_schema_set.py +534 -0
- xml_auditfile-0.0.1/src/xml_auditfile/xsd/_validator.py +429 -0
- xml_auditfile-0.0.1/tests/conftest.py +36 -0
- xml_auditfile-0.0.1/tests/data/xaf-3.2-sample.xaf +405 -0
- xml_auditfile-0.0.1/tests/test_api_contract.py +209 -0
- xml_auditfile-0.0.1/tests/test_custom_definitions.py +176 -0
- xml_auditfile-0.0.1/tests/test_definitions.py +44 -0
- xml_auditfile-0.0.1/tests/test_input_errors.py +104 -0
- xml_auditfile-0.0.1/tests/test_limits.py +47 -0
- xml_auditfile-0.0.1/tests/test_pandas.py +88 -0
- xml_auditfile-0.0.1/tests/test_polars.py +97 -0
- xml_auditfile-0.0.1/tests/test_read.py +112 -0
- xml_auditfile-0.0.1/tests/test_reference_limit.py +37 -0
- xml_auditfile-0.0.1/tests/test_row_accessors.py +88 -0
- xml_auditfile-0.0.1/tests/test_security.py +79 -0
- xml_auditfile-0.0.1/tests/test_stream_disposal.py +98 -0
- xml_auditfile-0.0.1/tests/test_values.py +56 -0
- xml_auditfile-0.0.1/tests/test_versions.py +37 -0
- xml_auditfile-0.0.1/tests/test_views.py +121 -0
- xml_auditfile-0.0.1/tests/test_xsd.py +68 -0
- xml_auditfile-0.0.1/tools/embed_spec.py +46 -0
- xml_auditfile-0.0.1/tools/fetch-spec.ps1 +80 -0
- xml_auditfile-0.0.1/tools/semver.ps1 +98 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here.
|
|
4
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
5
|
+
and the project uses [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Custom dialects and views at runtime, in the format of auditfile-spec: `Auditfile.dialects.add(version, json)` and
|
|
11
|
+
`Auditfile.views.add(json)`, with `remove` and `clear` (`DialectRegistry`, `ViewRegistry`). They appear after the
|
|
12
|
+
built-in ones in `AuditfileVersion.dialects`, `views` and `find_view`.
|
|
13
|
+
- Typed row accessors (`get_string`, `get_decimal`, `get_integer`, `get_date`, `get_datetime`, `get_time`, `get_boolean`) that check the column type, also with a column looked up once.
|
|
14
|
+
- Report counts per severity that include diagnostics left out of a full list; errors take the place of infos and warnings.
|
|
15
|
+
- Cancellation in the scan and load phases; XAF-S006 (missing required field) in unverified mode; XAF-X004 for a part of a
|
|
16
|
+
split file in another encoding than the first part.
|
|
17
|
+
- Dialect actions, view aggregates and view operators are checked when the definitions are loaded.
|
|
18
|
+
- `DialectAction`, `ViewAggregate` and `ViewOperator` enums; `ReadOptions.cancel`, `ReadCancelledError`, `SinkAbortError`.
|
|
19
|
+
- pandas DataFrames, with the optional extra `pandas`: `MemorySink.to_pandas(table)` (index `_id`, column `_parent_id`)
|
|
20
|
+
and `ViewResult.to_pandas()`; amounts stay exact `Decimal` unless `decimals="float"`.
|
|
21
|
+
- polars DataFrames, with the optional extra `polars`: `MemorySink.to_polars(table)` (columns `_id`, `_parent_id`) and
|
|
22
|
+
`ViewResult.to_polars()`; amounts get an exact `Decimal` type unless `decimals="float"`.
|
|
23
|
+
- Views: joins with `alternatives` (`ViewJoin.alternatives`) and the `pseudonym` operation (`ViewOperator.PSEUDONYM`,
|
|
24
|
+
`ViewValue.prefix`); the views `ledger` and `ledger_pseudonymized`.
|
|
25
|
+
- Streaming reader for XAF and related audit files, ported from auditfile-dotnet with the same API in Python style:
|
|
26
|
+
`Auditfile.read`, `validate`, `scan` and `open`, `AuditfileSource`, `AuditfileVersion`, `AuditfileSchema` with JSON round-trip,
|
|
27
|
+
the `Sink` protocol and `MemorySink`, views (`ViewDefinition.run`, `MemorySink.run`).
|
|
28
|
+
- Version resolution (forced, registry, alias, resolver), scan and load phases, split audit files, dialect corrections,
|
|
29
|
+
key and reference checks, XAF business rules, diagnostics in Dutch and English.
|
|
30
|
+
- Streaming XSD validator for the XSD subset of auditfile-spec, including identity constraints.
|
|
31
|
+
- No dependencies; exact `Decimal` amounts.
|
|
32
|
+
- Security: DTDs refused, embedded-only XSD resolution, depth and diagnostic limits, caller-owned streams left open.
|
|
@@ -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 [yyyy] [name of copyright owner]
|
|
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.
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: xml-auditfile
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Streaming reader for Dutch tax audit files (XAF and related), following auditfile-spec.
|
|
5
|
+
Project-URL: Repository, https://github.com/XML-auditfile/auditfile-py
|
|
6
|
+
Project-URL: Specification, https://github.com/XML-auditfile/auditfile-spec
|
|
7
|
+
Author: XML-auditfile
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Office/Business :: Financial :: Accounting
|
|
14
|
+
Classifier: Topic :: Text Processing :: Markup :: XML
|
|
15
|
+
Classifier: Typing :: Typed
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Provides-Extra: pandas
|
|
18
|
+
Requires-Dist: pandas>=2.0; extra == 'pandas'
|
|
19
|
+
Provides-Extra: polars
|
|
20
|
+
Requires-Dist: polars>=1.0; extra == 'polars'
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: pandas>=2.0; extra == 'test'
|
|
23
|
+
Requires-Dist: polars>=1.0; extra == 'test'
|
|
24
|
+
Requires-Dist: pytest>=8; extra == 'test'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# auditfile-py
|
|
28
|
+
|
|
29
|
+
Streaming reader for Dutch tax audit files (XAF and related), following
|
|
30
|
+
[auditfile-spec](https://github.com/XML-auditfile/auditfile-spec). The Python counterpart of
|
|
31
|
+
[auditfile-dotnet](https://github.com/XML-auditfile/auditfile-dotnet), with the same API in Python style.
|
|
32
|
+
|
|
33
|
+
> Status: draft (0.x).
|
|
34
|
+
> Not affiliated with the Belastingdienst, SRA or any software vendor.
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from xml_auditfile import Auditfile, AuditfileSource, MemorySink
|
|
38
|
+
|
|
39
|
+
sink = MemorySink()
|
|
40
|
+
source = AuditfileSource.from_factory(lambda: open("administratie.xaf", "rb"), "administratie.xaf")
|
|
41
|
+
report = Auditfile.read(source, sink)
|
|
42
|
+
|
|
43
|
+
for diagnostic in report.diagnostics:
|
|
44
|
+
print(diagnostic)
|
|
45
|
+
|
|
46
|
+
for line in sink.rows("tr_line"):
|
|
47
|
+
print(line.get_string("acc_id"), line.get_decimal("amnt"), line.get_string("amnt_tp"))
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Rows have typed accessors (`get_string`, `get_decimal`, `get_integer`, `get_date`, `get_datetime`, `get_time`, `get_boolean`)
|
|
51
|
+
that check the column type and name the problem; `"amnt" in row` tells whether a column exists in this version. `get_decimal`
|
|
52
|
+
also reads an integer column, since a column can be integer in one version and decimal in another. In a loop over many rows,
|
|
53
|
+
look the column up once (`table.find_column("amnt")`) and pass it instead of the name.
|
|
54
|
+
|
|
55
|
+
Values are read in XSD notation only: a date-time such as `03/01/2017 10:00:00` is refused (XAF-S004) rather than guessed.
|
|
56
|
+
|
|
57
|
+
No dependencies: XML parsing uses the standard library's expat parser, XSD validation is built in.
|
|
58
|
+
|
|
59
|
+
## pandas and polars
|
|
60
|
+
|
|
61
|
+
``pip install xml-auditfile[pandas]`` or ``xml-auditfile[polars]`` adds DataFrames; the reader itself still needs
|
|
62
|
+
nothing else.
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
lines = sink.to_pandas("tr_line") # index _id, column _parent_id, then the table columns
|
|
66
|
+
transactions = sink.to_pandas("transaction")
|
|
67
|
+
lines = lines.merge(transactions, left_on="_parent_id", right_index=True, suffixes=("", "_transaction"))
|
|
68
|
+
|
|
69
|
+
ledger = sink.run(AuditfileVersion.Financial.V3_2.find_view("ledger_pseudonymized")).to_pandas()
|
|
70
|
+
ledger.groupby("account")["amount"].sum()
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Strings, integers and booleans get nullable pandas types (``string``, ``Int64``, ``boolean``), dates and date-times
|
|
74
|
+
``datetime64`` (date-times in UTC when the file gives a time zone), times stay ``datetime.time``. Amounts stay exact
|
|
75
|
+
``Decimal`` objects, so sums are exact; ``to_pandas(..., decimals="float")`` gives ``float64`` for speed.
|
|
76
|
+
``ViewResult.to_pandas(labels=TextLanguage.DUTCH)`` names the columns by their labels (``Bedrag``) instead of their names.
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
lines = sink.to_polars("tr_line") # columns _id and _parent_id, then the table columns
|
|
80
|
+
transactions = sink.to_polars("transaction")
|
|
81
|
+
lines = lines.join(transactions, left_on="_parent_id", right_on="_id", how="left", suffix="_transaction")
|
|
82
|
+
|
|
83
|
+
ledger = sink.run(AuditfileVersion.Financial.V3_2.find_view("ledger_pseudonymized")).to_polars()
|
|
84
|
+
ledger.group_by("account").agg(pl.col("amount").sum())
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
polars has no index, so ``_id`` is the first column. Every column gets the polars type of its column type (``String``,
|
|
88
|
+
``Int64``, ``Boolean``, ``Date``, ``Datetime`` in UTC when the file gives a time zone, ``Time``). Amounts get an exact
|
|
89
|
+
``Decimal`` type with the largest scale in the column, so sums are exact; ``decimals="float"`` gives ``Float64``.
|
|
90
|
+
|
|
91
|
+
## What it does
|
|
92
|
+
|
|
93
|
+
- **Determines the version**: forced in code, official namespace or alias from the registry, optionally
|
|
94
|
+
derived from the namespace (`use_resolver`). Anything else stops with a clear diagnostic.
|
|
95
|
+
- **Reads in two phases**: scan (validate against the built-in XSD, count rows per table) and load
|
|
96
|
+
(stream rows in batches to a sink). Verified mode loads only a valid file.
|
|
97
|
+
- **Turns every repeating element into a table** following the manifest generated by auditfile-spec.
|
|
98
|
+
Rows know their id, parent, position and source part; values are typed.
|
|
99
|
+
- **Checks** required and expected tables, keys, references and the XAF business rules
|
|
100
|
+
(balanced transactions, header counts and totals).
|
|
101
|
+
- **Reads split audit files** (`audit.xaf`, `audit-2.xaf`, ...) as one file; you pass the parts in order.
|
|
102
|
+
- **Reports** everything as diagnostics with stable codes, in Dutch or English.
|
|
103
|
+
|
|
104
|
+
## Entry points
|
|
105
|
+
|
|
106
|
+
| Call | Use |
|
|
107
|
+
| ---- | --- |
|
|
108
|
+
| `Auditfile.read(source, sink, options)` | Read into a sink: `MemorySink` or your own sink |
|
|
109
|
+
| `Auditfile.validate(source, options)` | Validate without storing anything; `mode=ReadMode.UNVERIFIED` skips the XSD |
|
|
110
|
+
| `Auditfile.scan(source, options)` | Version, XSD validation and row counts only |
|
|
111
|
+
| `Auditfile.open(source, options).read_rows()` | Stream rows yourself; the rows can be iterated once |
|
|
112
|
+
| `AuditfileVersion.Financial.V3_2` | Manifest, XSD, definitions, dialects and views of a version |
|
|
113
|
+
| `Auditfile.dialects.add(version, json)` / `Auditfile.views.add(json)` | Add your own dialects and views next to the built-in ones (see below) |
|
|
114
|
+
| `schema.to_json()` / `AuditfileSchema.from_json()` | Store and restore the schema of an import |
|
|
115
|
+
|
|
116
|
+
Sources: the reader never opens files; you supply binary streams (anything with `read(n)` returning bytes) or bytes.
|
|
117
|
+
|
|
118
|
+
| Call | Use |
|
|
119
|
+
| ---- | --- |
|
|
120
|
+
| `AuditfileSource.from_factory(open, name)` | Fresh stream per call: can be read twice (scan, then load) |
|
|
121
|
+
| `AuditfileSource.from_factories((name, open), ...)` | Same, for the parts of a split audit file |
|
|
122
|
+
| `AuditfileSource.from_stream(stream, name)` | Read once; validation then happens during loading. The stream is not closed |
|
|
123
|
+
| `AuditfileSource.from_streams((name, stream), ...)` | Same, for the parts of a split audit file |
|
|
124
|
+
|
|
125
|
+
Options are a frozen dataclass: `ReadOptions(version=..., mode=ReadMode.UNVERIFIED, use_resolver=..., xsd=...,
|
|
126
|
+
apply_dialects=..., batch_size=..., language=TextLanguage.ENGLISH, max_diagnostics=..., max_depth=...,
|
|
127
|
+
max_characters_in_document=..., max_value_length=..., on_progress=..., cancel=threading.Event())`. Values out of range are
|
|
128
|
+
refused with a `ValueError`. Set the `cancel` event from another thread to stop reading, in the scan phase as well as
|
|
129
|
+
the load phase; the call then raises `ReadCancelledError`. When a sink fails and its `abort` fails too, the read raises a
|
|
130
|
+
`SinkAbortError` holding both errors (`error`, `abort_error`).
|
|
131
|
+
|
|
132
|
+
A sink is any object with `begin(context)`, `write(table, rows)`, `complete(report)` and `abort(report)` (the `Sink`
|
|
133
|
+
protocol). Set `capabilities = SinkCapabilities.NEEDS_ROW_COUNTS` to get row counts before the first row.
|
|
134
|
+
|
|
135
|
+
## Custom dialects and views
|
|
136
|
+
|
|
137
|
+
Dialects and views come from auditfile-spec and are built into the package. You can add your own at runtime, in the same
|
|
138
|
+
format as `dialects.json` and `views/<type>.json` of the spec, without a fork or a custom build. Pass JSON text
|
|
139
|
+
(`str` or UTF-8 `bytes`) or the parsed `dict`; the reader opens no files, so read them yourself.
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
from pathlib import Path
|
|
143
|
+
from xml_auditfile import Auditfile, AuditfileVersion
|
|
144
|
+
|
|
145
|
+
# {"formatVersion": 1, "dialects": [{"name": "my-package", "match": {...}, "corrections": [...]}]}
|
|
146
|
+
Auditfile.dialects.add(AuditfileVersion.Financial.V3_2, Path("dialects.json").read_text("utf-8")) # or "xaf/3.2"
|
|
147
|
+
|
|
148
|
+
# {"formatVersion": 1, "type": "xaf", "views": [{"name": "lines_per_account", ...}]}
|
|
149
|
+
Auditfile.views.add(Path("views.json").read_bytes())
|
|
150
|
+
|
|
151
|
+
report = Auditfile.read(source, sink) # recognizes and applies the added dialect
|
|
152
|
+
result = sink.run(sink.schema.version.find_view("lines_per_account"))
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- Added definitions come after the built-in ones in `version.dialects` and `version.views`, so `find_view`, version
|
|
156
|
+
resolution and dialect corrections use them like the built-in ones. A view is added for every version of its `type`;
|
|
157
|
+
whether it fits a version is decided when it runs (XAF-Q001), as for built-in views. `apply_dialects=False` ignores
|
|
158
|
+
added dialects too.
|
|
159
|
+
- A file is checked when it is added and refused as a whole when anything is wrong (`JsonFormatError`, a `ValueError`):
|
|
160
|
+
invalid JSON, a `formatVersion` other than 1, an unknown dialect action, view aggregate or operator, or a correction
|
|
161
|
+
`code` that is not a dialect diagnostic (XAF-C001–C003). An unknown audit file type or version, or a name the version
|
|
162
|
+
or type already has, raises a `ValueError`. Built-in definitions cannot be replaced or removed.
|
|
163
|
+
- `Auditfile.dialects.remove(version, name)` and `Auditfile.views.remove(type, name)` remove one added definition;
|
|
164
|
+
`clear()` removes all of them. The registries are thread-safe and shared by every read in the process; a read that
|
|
165
|
+
has started keeps the dialects it found.
|
|
166
|
+
|
|
167
|
+
## Values
|
|
168
|
+
|
|
169
|
+
| Column type | Python value |
|
|
170
|
+
| ----------- | ------------ |
|
|
171
|
+
| `string` | `str` |
|
|
172
|
+
| `decimal` | `decimal.Decimal`, exact with the scale as written; totals are added without rounding |
|
|
173
|
+
| `integer` | `int`, within the range of a 64-bit integer |
|
|
174
|
+
| `date` | `datetime.date`; a time zone in the file is ignored |
|
|
175
|
+
| `datetime` | `datetime.datetime`, aware when the file gives a time zone |
|
|
176
|
+
| `time` | `datetime.time` |
|
|
177
|
+
| `boolean` | `bool` |
|
|
178
|
+
|
|
179
|
+
## Security
|
|
180
|
+
|
|
181
|
+
The reader is built for files from untrusted sources:
|
|
182
|
+
|
|
183
|
+
- DTDs are refused, so no entity can be declared or expanded and nothing external is loaded (XXE, billion laughs).
|
|
184
|
+
- XSD imports resolve only to the definitions embedded in the package; never to disk or network.
|
|
185
|
+
- Nesting deeper than `max_depth` (64) stops reading; the root element must appear within the first megabyte.
|
|
186
|
+
- Memory grows with the number of keys (accounts, customers and suppliers, ...), not with the number of lines:
|
|
187
|
+
only open elements, key values, unresolved references (at most 100,000 per reference, XAF-R017 beyond that) and
|
|
188
|
+
the totals of transactions being read are kept, and the diagnostics list is capped at `max_diagnostics`.
|
|
189
|
+
- Text streams are refused (their encoding is unknown); a stream you pass with `from_stream` is never closed.
|
|
190
|
+
|
|
191
|
+
## Diagnostics
|
|
192
|
+
|
|
193
|
+
Every finding is a diagnostic with a stable code from `diagnostics.json` of auditfile-spec. The report lists at most
|
|
194
|
+
`max_diagnostics` (default 1000), followed by XAF-X900 when more were found. A full list makes room for errors by
|
|
195
|
+
leaving out infos and warnings, and fatal diagnostics are always included. `is_valid`, `has_errors`, `has_fatal` and
|
|
196
|
+
`count(severity)` count every diagnostic, also the ones left out; `is_truncated` says whether some were.
|
|
197
|
+
|
|
198
|
+
| Layer | Codes this reader reports |
|
|
199
|
+
| ----- | ------------------------- |
|
|
200
|
+
| XML | X001–X004 (X004 also for a part of a split file in another encoding than the first part), X900 |
|
|
201
|
+
| Version | V001–V006 |
|
|
202
|
+
| Structure | S001–S005, S008; S006 in unverified mode (in verified mode the XSD reports a missing field as D001) |
|
|
203
|
+
| XSD | D001, D002 |
|
|
204
|
+
| Rules | R001–R004, R017 |
|
|
205
|
+
| Dialect | C001–C003, when a dialect applies |
|
|
206
|
+
| Views | Q001, Q002 |
|
|
207
|
+
|
|
208
|
+
Defined in the spec but not checked yet: S007 and S009 (in verified mode the XSD reports too many occurrences and
|
|
209
|
+
values outside a code list as D001), R005–R016 (ascending numbers, periods, eleven test, IBAN, personal data),
|
|
210
|
+
X005 (the XML parser reports an invalid character as X001) and E001–E004 (envelopes).
|
|
211
|
+
|
|
212
|
+
## XSD validation
|
|
213
|
+
|
|
214
|
+
Validation uses a streaming validator for the XSD subset that auditfile-spec uses: global and local elements,
|
|
215
|
+
sequences with occurrence bounds, attributes, simple types with facets (enumeration, pattern, length, digits, ranges,
|
|
216
|
+
white space) and `key`/`keyref`/`unique`. Every XSD of the registry compiles; a custom XSD (`xsd` option) that uses
|
|
217
|
+
anything else (such as `xs:choice` or `xs:any`) is refused with `XsdError` when it is compiled, never validated halfway.
|
|
218
|
+
Like the .NET reader, identity constraints follow XPath 1.0: an unprefixed step selects elements without namespace.
|
|
219
|
+
|
|
220
|
+
## Layout
|
|
221
|
+
|
|
222
|
+
| Path | Contents |
|
|
223
|
+
| ---- | -------- |
|
|
224
|
+
| `src/xml_auditfile/` | The reader; `memory.py` holds `MemorySink`, `xsd/` the XSD validator |
|
|
225
|
+
| `tests/` | Tests (pytest), using the XAF 3.2 sample in `tests/data/xaf-3.2-sample.xaf` (two intended findings: XAF-R001, XAF-R003) |
|
|
226
|
+
| `spec.lock.json` | The pinned auditfile-spec release |
|
|
227
|
+
| `tools/` | `fetch-spec.ps1` (copies `generated/` of the pinned spec into `spec/generated/`), `embed_spec.py` and `semver.ps1` (version checks of the release workflow) |
|
|
228
|
+
|
|
229
|
+
Example programs live in [auditfile-py-samples](https://github.com/XML-auditfile/auditfile-py-samples).
|
|
230
|
+
|
|
231
|
+
## Definitions
|
|
232
|
+
|
|
233
|
+
Everything in `generated/` of a pinned auditfile-spec release is embedded in the package as `xml_auditfile/_spec/`.
|
|
234
|
+
The spec is not committed: `spec.lock.json` pins a commit, `tools/fetch-spec.ps1` copies only
|
|
235
|
+
`generated/` of that commit into `spec/generated/` (git-ignored; a plain folder, not a git checkout), and `tools/embed_spec.py` copies it into the package before testing and building.
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
pwsh tools/fetch-spec.ps1 # after cloning and whenever spec.lock.json changes
|
|
239
|
+
python tools/embed_spec.py
|
|
240
|
+
pip install -e ".[test]"
|
|
241
|
+
pytest
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
To use a local spec checkout instead: `SPEC_ROOT=../auditfile-spec python tools/embed_spec.py`.
|
|
245
|
+
|
|
246
|
+
## Workflows
|
|
247
|
+
|
|
248
|
+
| Workflow | What it does |
|
|
249
|
+
| -------- | ------------ |
|
|
250
|
+
| `ci.yml` | Push to main and pull requests: fetch the pinned spec, embed it, install, test on Python 3.10, 3.12 and 3.13, build the sdist and wheel and check them |
|
|
251
|
+
| `release.yml` | Manual, with a version such as `1.0.1`. From `main` the version must be higher than every release; from `release/X.Y` (maintenance of an older line, e.g. a security fix `0.1.1` after `1.0.0`, branched off tag `0.1.0`) it must be in line X.Y and higher than the latest release in that line. Pre-releases are `-alpha.N`, `-beta.N` or `-rc.N`; the tag keeps the semantic version, the package gets the PEP 440 form (`1.1.0-beta.1` becomes `1.1.0b1`). Then it fetches and embeds the pinned spec, builds, tests the wheel, creates the tag and GitHub release, and publishes to PyPI through Trusted Publishing when the `PYPI_PUBLISH` variable is `true` (environment `pypi`) |
|
|
252
|
+
| `dependabot.yml` | Weekly updates of pip packages and GitHub Actions |
|
|
253
|
+
|
|
254
|
+
## License
|
|
255
|
+
|
|
256
|
+
Apache License 2.0.
|