vdi2770-validate 0.1.0__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.
- vdi2770_validate-0.1.0/.github/dco.yml +2 -0
- vdi2770_validate-0.1.0/.github/workflows/ci.yml +36 -0
- vdi2770_validate-0.1.0/.github/workflows/release.yml +54 -0
- vdi2770_validate-0.1.0/CHANGELOG.md +29 -0
- vdi2770_validate-0.1.0/CONTRIBUTING.md +53 -0
- vdi2770_validate-0.1.0/LICENSE +202 -0
- vdi2770_validate-0.1.0/MANIFEST.in +11 -0
- vdi2770_validate-0.1.0/Makefile +34 -0
- vdi2770_validate-0.1.0/NOTICE +45 -0
- vdi2770_validate-0.1.0/PKG-INFO +119 -0
- vdi2770_validate-0.1.0/README.md +96 -0
- vdi2770_validate-0.1.0/SECURITY.md +30 -0
- vdi2770_validate-0.1.0/THIRD_PARTY.md +121 -0
- vdi2770_validate-0.1.0/corpus/MANIFEST.json +207 -0
- vdi2770_validate-0.1.0/corpus/NOTICE +29 -0
- vdi2770_validate-0.1.0/corpus/examples/.gitignore +1 -0
- vdi2770_validate-0.1.0/corpus/examples/Invalid1.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/Invalid2.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/InvalidName.xml +58 -0
- vdi2770_validate-0.1.0/corpus/examples/InvalidXMLName.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/PDFA1b_File.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/PDFA2b_File.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/PDFA3b_File.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/VDI2770_Main.xml +58 -0
- vdi2770_validate-0.1.0/corpus/examples/Valid.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/certificate-pdfa-a.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/certificate-pdfa-b.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/document-invalid-pdfa-b.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/documentationcontainer.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/documentcontainer-invalid.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/documentcontainer.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/missingdocuments.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/morethanonepdfcontainer.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/objectreferences.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/vdi2770_demo.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/container/vdi2770_excel.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/demo_invalid_doc_type_names.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/demo_vdi.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/empty.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/456-29201/VDI2770_Metadata.xml +63 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/456-29201/demo.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/456-29201/demo.xlsx +0 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/AB393/VDI2770_Metadata.xml +67 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/AB393/demo.docx +0 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/AB393/demo.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/VDI2770_Main.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/folders/VDI2770_Main.xml +58 -0
- vdi2770_validate-0.1.0/corpus/examples/issues/issue16container.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/missing_Maindocument.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/missing_Metadata.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/missingdocuments/VDI2770_Main.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/missingdocuments/VDI2770_Main.xml +57 -0
- vdi2770_validate-0.1.0/corpus/examples/missingdocuments/folders.zip +0 -0
- vdi2770_validate-0.1.0/corpus/examples/pdf/encrypted.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/pdf/password.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/pdf/scan.pdf +0 -0
- vdi2770_validate-0.1.0/corpus/examples/statistics.csv +14 -0
- vdi2770_validate-0.1.0/corpus/examples/xml/Datasheet.xml +83 -0
- vdi2770_validate-0.1.0/corpus/examples/xml/Invalid1.xml +90 -0
- vdi2770_validate-0.1.0/corpus/examples/xml/Invalid2.xml +83 -0
- vdi2770_validate-0.1.0/corpus/examples/xml/InvalidEmpty.xml +55 -0
- vdi2770_validate-0.1.0/corpus/examples/xml/Maindocument.xml +116 -0
- vdi2770_validate-0.1.0/corpus/examples/xml/MissingXmlNs.xml +81 -0
- vdi2770_validate-0.1.0/corpus/examples/xml/validation.xml +102 -0
- vdi2770_validate-0.1.0/docs/divergences.md +136 -0
- vdi2770_validate-0.1.0/docs/findings.md +133 -0
- vdi2770_validate-0.1.0/docs/licensing.md +51 -0
- vdi2770_validate-0.1.0/docs/rule-coverage.json +42 -0
- vdi2770_validate-0.1.0/docs/scope.md +65 -0
- vdi2770_validate-0.1.0/pyproject.toml +59 -0
- vdi2770_validate-0.1.0/setup.cfg +4 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/__init__.py +2 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/__main__.py +5 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/catalog.py +77 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/cli.py +82 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/data/VDI2770_Schema_2019-08-23.xsd +287 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/data/document-classes.json +206 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/data/rules.json +468 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/domain.py +110 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/model.py +124 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/readers/__init__.py +0 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/readers/pdfread.py +88 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/readers/xmlread.py +111 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/readers/xsdvalidate.py +73 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/readers/zipread.py +224 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/report.py +63 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/resources.py +19 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/rules/__init__.py +5 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/rules/container.py +71 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/rules/files.py +48 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/rules/metadata.py +98 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/rules/pdf.py +35 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/rules/schema.py +28 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate/runner.py +79 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate.egg-info/PKG-INFO +119 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate.egg-info/SOURCES.txt +124 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate.egg-info/dependency_links.txt +1 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate.egg-info/entry_points.txt +2 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate.egg-info/requires.txt +5 -0
- vdi2770_validate-0.1.0/src/vdi2770_validate.egg-info/top_level.txt +1 -0
- vdi2770_validate-0.1.0/tests/conftest.py +10 -0
- vdi2770_validate-0.1.0/tests/data/oracle-messages.json +245 -0
- vdi2770_validate-0.1.0/tests/test_amplification.py +64 -0
- vdi2770_validate-0.1.0/tests/test_catalogue.py +113 -0
- vdi2770_validate-0.1.0/tests/test_ci_parity.py +94 -0
- vdi2770_validate-0.1.0/tests/test_cli.py +98 -0
- vdi2770_validate-0.1.0/tests/test_defences.py +171 -0
- vdi2770_validate-0.1.0/tests/test_determinism.py +29 -0
- vdi2770_validate-0.1.0/tests/test_evasion.py +139 -0
- vdi2770_validate-0.1.0/tests/test_layering.py +49 -0
- vdi2770_validate-0.1.0/tests/test_licensing.py +84 -0
- vdi2770_validate-0.1.0/tests/test_model.py +35 -0
- vdi2770_validate-0.1.0/tests/test_no_false_positives_on_the_reference_corpus.py +34 -0
- vdi2770_validate-0.1.0/tests/test_offline.py +48 -0
- vdi2770_validate-0.1.0/tests/test_pdf_precision.py +69 -0
- vdi2770_validate-0.1.0/tests/test_promises.py +94 -0
- vdi2770_validate-0.1.0/tests/test_readers.py +104 -0
- vdi2770_validate-0.1.0/tests/test_readme_sample.py +32 -0
- vdi2770_validate-0.1.0/tests/test_rule_pairs.py +58 -0
- vdi2770_validate-0.1.0/tests/test_tool_limits_are_not_verdicts.py +55 -0
- vdi2770_validate-0.1.0/tests/test_version_is_one_number.py +56 -0
- vdi2770_validate-0.1.0/tests/tools_shim.py +13 -0
- vdi2770_validate-0.1.0/tools/check_sdist.py +47 -0
- vdi2770_validate-0.1.0/tools/make_fixtures.py +233 -0
- vdi2770_validate-0.1.0/tools/rule_coverage.py +108 -0
- vdi2770_validate-0.1.0/tools/vendor_corpus.py +94 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.9", "3.12"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ matrix.python-version }}
|
|
19
|
+
- name: Install
|
|
20
|
+
run: |
|
|
21
|
+
python -m pip install --upgrade pip
|
|
22
|
+
python -m pip install -e ".[dev]"
|
|
23
|
+
- name: Lint
|
|
24
|
+
run: python -m ruff check src tests tools
|
|
25
|
+
- name: Build fixtures
|
|
26
|
+
run: python tools/make_fixtures.py
|
|
27
|
+
- name: Test
|
|
28
|
+
run: python -m pytest
|
|
29
|
+
- name: Corpus is unchanged
|
|
30
|
+
run: python tools/vendor_corpus.py --check
|
|
31
|
+
- name: Firing coverage
|
|
32
|
+
run: python tools/rule_coverage.py --check
|
|
33
|
+
- name: The sdist can run its own tests
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install build
|
|
36
|
+
python tools/check_sdist.py
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# One package in this repository, so one environment. The collision that bit the
|
|
4
|
+
# sibling project was two packages sharing a (repo, workflow, environment) tuple;
|
|
5
|
+
# splitting further here would be ceremony, not safety.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags: ["v*"]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- name: Install
|
|
20
|
+
run: |
|
|
21
|
+
python -m pip install --upgrade pip build
|
|
22
|
+
python -m pip install -e ".[dev]"
|
|
23
|
+
- name: The gate must pass on the tagged tree
|
|
24
|
+
run: |
|
|
25
|
+
python -m ruff check src tests tools
|
|
26
|
+
python tools/make_fixtures.py
|
|
27
|
+
python -m pytest
|
|
28
|
+
python tools/vendor_corpus.py --check
|
|
29
|
+
python tools/rule_coverage.py --check
|
|
30
|
+
python tools/check_sdist.py
|
|
31
|
+
- name: The tag must be the version
|
|
32
|
+
run: |
|
|
33
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
34
|
+
pkg=$(python -c "import sys; sys.path.insert(0,'src'); import vdi2770_validate as v; print(v.__version__)")
|
|
35
|
+
test "$tag" = "$pkg" || { echo "tag $tag != package $pkg"; exit 1; }
|
|
36
|
+
- name: Build
|
|
37
|
+
run: python -m build
|
|
38
|
+
- uses: actions/upload-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: dist
|
|
41
|
+
path: dist/
|
|
42
|
+
|
|
43
|
+
publish:
|
|
44
|
+
needs: build
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
environment: pypi
|
|
47
|
+
permissions:
|
|
48
|
+
id-token: write # Trusted Publishing; no API token is stored anywhere
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/download-artifact@v4
|
|
51
|
+
with:
|
|
52
|
+
name: dist
|
|
53
|
+
path: dist/
|
|
54
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 — 2026-08-24
|
|
4
|
+
|
|
5
|
+
First release. It reads a VDI 2770 container and tells you what is wrong with
|
|
6
|
+
it, offline, with a remedy on every finding.
|
|
7
|
+
|
|
8
|
+
What 0.1.0 means here: the 33 rules it has are gated — each was killed in turn to
|
|
9
|
+
confirm the suite notices, 22 have a minimal violating/conforming fixture pair,
|
|
10
|
+
and the rest are exercised by the reference project's own examples, which no
|
|
11
|
+
structural rule is allowed to fire on. What it does *not* mean is broad coverage
|
|
12
|
+
of VDI 2770. The scope is small and written down in docs/scope.md, and the
|
|
13
|
+
refusals there are the honest part.
|
|
14
|
+
|
|
15
|
+
- Reads VDI 2770 document and documentation containers without extracting them.
|
|
16
|
+
- 32 rules across five layers — container shape, schema conformance, declared
|
|
17
|
+
files versus actual members, metadata model, and PDF claims — each with a
|
|
18
|
+
remedy sentence and each traceable to the schema VDI publishes free, to a
|
|
19
|
+
freely published table, to container mechanics, or to a stated judgement of
|
|
20
|
+
our own.
|
|
21
|
+
- Document classification matched on class id and German name. The two freely
|
|
22
|
+
published sources disagree on five of twelve English names, so an English name
|
|
23
|
+
never decides a verdict here; it produces a note showing both renderings.
|
|
24
|
+
- Reports what a PDF *claims* about PDF/A. Does not verify the claim, and says so
|
|
25
|
+
on every line where it matters.
|
|
26
|
+
- Gates: fixture pairs, firing coverage, import layering, offline, determinism,
|
|
27
|
+
CI/local parity, the declared Python floor, licence notices, remedy text not
|
|
28
|
+
copied from the reference, no structural rule firing on an upstream example,
|
|
29
|
+
and the README sample being output the tool really produces.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## The Developer Certificate of Origin
|
|
4
|
+
|
|
5
|
+
Every commit carries a `Signed-off-by` line — `git commit -s`. That is a
|
|
6
|
+
[certificate of origin](https://developercertificate.org/), not a transfer of
|
|
7
|
+
rights; you keep the copyright in what you write.
|
|
8
|
+
|
|
9
|
+
## Before you open a pull request
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
python -m pip install -e ".[dev]"
|
|
13
|
+
make check
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`make check` is the whole gate: lint, build the fixtures, tests, the corpus is
|
|
17
|
+
unchanged, and every rule still fires. CI runs exactly those commands — a test asserts that, because
|
|
18
|
+
"the same command" is not the same thing as "the same environment".
|
|
19
|
+
|
|
20
|
+
## Three rules of the road
|
|
21
|
+
|
|
22
|
+
Each exists because ignoring it would break something specific.
|
|
23
|
+
|
|
24
|
+
1. **A new rule is a row in `rules.json` plus a function.** The row carries where
|
|
25
|
+
the requirement comes from, and a remedy sentence saying what the user should
|
|
26
|
+
*do*. A finding that only restates the problem is half a finding.
|
|
27
|
+
|
|
28
|
+
2. **A new rule needs a fixture pair.** One container that violates it, one that
|
|
29
|
+
does not, differing in as little as possible — add the violating one to
|
|
30
|
+
`tools/make_fixtures.py`. A rule that has never been seen to fire has never
|
|
31
|
+
been tested, and `make check` will say so.
|
|
32
|
+
|
|
33
|
+
3. **Rules may not import a parser.** `tests/test_layering.py` fails if a module
|
|
34
|
+
under `rules/` imports `zipfile` or an XML library. (Rules do import the
|
|
35
|
+
readers' reserved file names — that exemption is written into the test.)
|
|
36
|
+
Rules read the model; how the document was spelled is not their business.
|
|
37
|
+
|
|
38
|
+
## Where the requirement came from matters
|
|
39
|
+
|
|
40
|
+
`rules.json` gives every rule an `obligation`: `schema` (the XSD VDI publishes
|
|
41
|
+
free), `table` (a freely published table), `container` (mechanics anyone can
|
|
42
|
+
observe), or `ours` — and `ours` must carry a `whyOurs` sentence.
|
|
43
|
+
|
|
44
|
+
**The VDI 2770 guideline text is sold by DIN Media and is not used here.** Do not
|
|
45
|
+
quote or paraphrase it, even from memory, and do not copy message text from other
|
|
46
|
+
implementations into a remedy — a test checks for that. See
|
|
47
|
+
[docs/licensing.md](docs/licensing.md).
|
|
48
|
+
|
|
49
|
+
## Reporting something without writing code
|
|
50
|
+
|
|
51
|
+
An issue with a container that is judged wrongly — in either direction — is one
|
|
52
|
+
of the most useful things you can send. Strip anything confidential first; a
|
|
53
|
+
minimal archive that still reproduces is ideal.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Wooyong Lee (dev365code)
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# The sdist must be able to run its own tests, or a downstream packager building
|
|
2
|
+
# from it gets a green build that never ran the gate. This is the same class of
|
|
3
|
+
# error as a check that reads a path outside the repository: "the gate exists"
|
|
4
|
+
# and "the gate runs" differ only in someone else's environment.
|
|
5
|
+
include LICENSE NOTICE THIRD_PARTY.md CHANGELOG.md CONTRIBUTING.md SECURITY.md Makefile
|
|
6
|
+
recursive-include tests *.py *.json
|
|
7
|
+
recursive-include tools *.py
|
|
8
|
+
recursive-include corpus *
|
|
9
|
+
recursive-include docs *.md *.json
|
|
10
|
+
recursive-include .github *.yml
|
|
11
|
+
prune tests/fixtures
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# One entry point. CI runs exactly these targets — tests/test_ci_parity.py proves it.
|
|
2
|
+
PYTHON ?= python3
|
|
3
|
+
RUFF_VERSION := 0.16.3
|
|
4
|
+
PYTEST_VERSION := 8.3.4
|
|
5
|
+
XMLSCHEMA_VERSION := 4.2.0
|
|
6
|
+
|
|
7
|
+
.PHONY: check lint test fixtures corpus coverage-check sdist-runs-its-own-tests clean
|
|
8
|
+
|
|
9
|
+
check: lint fixtures test corpus coverage-check
|
|
10
|
+
|
|
11
|
+
lint:
|
|
12
|
+
$(PYTHON) -m ruff check src tests tools
|
|
13
|
+
|
|
14
|
+
test:
|
|
15
|
+
$(PYTHON) -m pytest
|
|
16
|
+
|
|
17
|
+
# Fixtures are generated, never committed: the generator is the source of truth.
|
|
18
|
+
fixtures:
|
|
19
|
+
$(PYTHON) tools/make_fixtures.py
|
|
20
|
+
|
|
21
|
+
corpus:
|
|
22
|
+
$(PYTHON) tools/vendor_corpus.py --check
|
|
23
|
+
|
|
24
|
+
coverage-check:
|
|
25
|
+
$(PYTHON) tools/rule_coverage.py --check
|
|
26
|
+
|
|
27
|
+
# A downstream packager builds from the sdist. If the sdist cannot run the gate,
|
|
28
|
+
# they get a green build that checked nothing — the same shape as a gate that
|
|
29
|
+
# reads a path outside the repository.
|
|
30
|
+
sdist-runs-its-own-tests:
|
|
31
|
+
$(PYTHON) tools/check_sdist.py
|
|
32
|
+
|
|
33
|
+
clean:
|
|
34
|
+
rm -rf .pytest_cache .ruff_cache build dist tests/fixtures **/__pycache__
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
vdi2770-validate
|
|
2
|
+
Copyright 2026 Wooyong Lee
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Wooyong Lee.
|
|
5
|
+
Licensed under the Apache License, Version 2.0.
|
|
6
|
+
|
|
7
|
+
--------------------------------------------------------------------------
|
|
8
|
+
Third-party material bundled with this project
|
|
9
|
+
--------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
1. VDI 2770 XML schema — src/vdi2770_validate/data/VDI2770_Schema_2019-08-23.xsd
|
|
12
|
+
|
|
13
|
+
Published free of charge by VDI (Verein Deutscher Ingenieure) on the
|
|
14
|
+
VDI 2770 guideline programme page. Redistributed verbatim, unmodified.
|
|
15
|
+
Retrieved 2026-08-21 from
|
|
16
|
+
https://www.vdi.de/fileadmin/pages/vdi_de/redakteure/richtlinien/dateien/vdi2770/VDI_2770_1_de_Deklaration_des_XML-Schemas_-_Declaration_of_the_XML_model.xsd
|
|
17
|
+
The download page states no licence or terms of use. The file is treated
|
|
18
|
+
as VDI's work and is redistributed unchanged. See docs/licensing.md.
|
|
19
|
+
|
|
20
|
+
2. VDI 2770 document class table — src/vdi2770_validate/data/document-classes.json
|
|
21
|
+
|
|
22
|
+
Table 1 of IDTA 02004 "Handover Documentation", Version 2.0.1 (November 2025),
|
|
23
|
+
Industrial Digital Twin Association e.V., published in
|
|
24
|
+
github.com/admin-shell-io/submodel-templates under CC BY 4.0.
|
|
25
|
+
Modified: the twelve rows were extracted and reformatted as JSON.
|
|
26
|
+
https://creativecommons.org/licenses/by/4.0/
|
|
27
|
+
|
|
28
|
+
3. Reference message catalogue — tests/data/oracle-messages.json
|
|
29
|
+
|
|
30
|
+
The English validation messages of the same reference implementation,
|
|
31
|
+
reproduced so the licensing gate in tests/test_catalogue.py can check that no
|
|
32
|
+
remedy text in this project was copied from them. Test data only; nothing in
|
|
33
|
+
the shipped package reads it.
|
|
34
|
+
MIT License, Copyright (C) 2021 Johannes Schmidt.
|
|
35
|
+
|
|
36
|
+
4. Conformance corpus — corpus/
|
|
37
|
+
|
|
38
|
+
Copied from github.com/DigitalDataChainConsortium/vdi2770 (examples/),
|
|
39
|
+
MIT License, Copyright (C) 2021 Johannes Schmidt. See corpus/NOTICE.
|
|
40
|
+
|
|
41
|
+
The text of the VDI 2770 guideline itself (VDI 2770 Blatt 1:2020-04) is sold
|
|
42
|
+
by DIN Media and is NOT included, quoted, or paraphrased anywhere in this
|
|
43
|
+
project. See docs/licensing.md.
|
|
44
|
+
|
|
45
|
+
Full provenance, licence texts and modification statements: THIRD_PARTY.md
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vdi2770-validate
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Offline conformance checker for VDI 2770 containers — every finding comes with a remedy
|
|
5
|
+
Author: Wooyong Lee
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: vdi2770,technical documentation,conformance,validation,industry 4.0
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Manufacturing
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
License-File: NOTICE
|
|
17
|
+
License-File: THIRD_PARTY.md
|
|
18
|
+
Requires-Dist: xmlschema==4.2.0
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest==8.3.4; extra == "dev"
|
|
21
|
+
Requires-Dist: ruff==0.16.3; extra == "dev"
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# vdi2770-validate
|
|
25
|
+
|
|
26
|
+
Point it at a VDI 2770 container and it tells you, offline, whether the archive is
|
|
27
|
+
one — and if something is wrong, what to do about it.
|
|
28
|
+
|
|
29
|
+
VDI 2770 is how manufacturers hand over technical documentation in the process
|
|
30
|
+
industry: PDFs bundled into ZIP "document containers" with an XML metadata file,
|
|
31
|
+
those bundled into a "documentation container". Operators in the process industry
|
|
32
|
+
increasingly ask for it in purchase orders, and a container rejected on intake holds
|
|
33
|
+
up a delivery. The reference implementation is a Java library and web service; this
|
|
34
|
+
is a small offline CLI you can drop into a CI job.
|
|
35
|
+
|
|
36
|
+
**Unofficial.** Not affiliated with VDI, the Digital Data Chain Consortium, or IDTA.
|
|
37
|
+
Names are used descriptively.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
$ vdi2770-validate check corpus/examples/missingdocuments/folders.zip
|
|
41
|
+
error F1 A file named in the metadata is not in the container
|
|
42
|
+
at folders.zip!/VDI2770_Main.xml:56:2
|
|
43
|
+
'VDI2770_Main.pdf' is declared but not in the archive
|
|
44
|
+
-> Add the missing file to the container, or remove its DigitalFile entry from the metadata. The two must agree.
|
|
45
|
+
error Z7 The documentation container has no VDI2770_Main.pdf
|
|
46
|
+
at folders.zip
|
|
47
|
+
-> Add the main document as VDI2770_Main.pdf at the root of the documentation container, next to VDI2770_Main.xml.
|
|
48
|
+
warn F2 A file in the container is not named in the metadata
|
|
49
|
+
at folders.zip!/456-29201/VDI2770_Metadata.xml
|
|
50
|
+
-> Declare the file as a DigitalFile in the metadata, or remove it from the container. An undeclared file is invisible to the recipient's system.
|
|
51
|
+
warn F2 A file in the container is not named in the metadata
|
|
52
|
+
at folders.zip!/456-29201/demo.pdf
|
|
53
|
+
-> Declare the file as a DigitalFile in the metadata, or remove it from the container. An undeclared file is invisible to the recipient's system.
|
|
54
|
+
warn F2 A file in the container is not named in the metadata
|
|
55
|
+
at folders.zip!/456-29201/demo.xlsx
|
|
56
|
+
-> Declare the file as a DigitalFile in the metadata, or remove it from the container. An undeclared file is invisible to the recipient's system.
|
|
57
|
+
warn F2 A file in the container is not named in the metadata
|
|
58
|
+
|
|
59
|
+
… 6 more warnings of the same kind
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
That is real output on a container that ships with this repository, so the same command works after cloning.
|
|
63
|
+
|
|
64
|
+
## What it will not tell you
|
|
65
|
+
|
|
66
|
+
**Whether a PDF really is PDF/A.** That needs a full PDF/A validator such as
|
|
67
|
+
veraPDF. This tool reports what a file *claims*, which catches the common failure:
|
|
68
|
+
files that never claimed at all. It says so on every line where it matters, and the
|
|
69
|
+
JSON output carries `"pdfaVerified": false` on every path. The rest of the refusals
|
|
70
|
+
are in [docs/scope.md](docs/scope.md).
|
|
71
|
+
|
|
72
|
+
## How it is built
|
|
73
|
+
|
|
74
|
+
- **Offline by design.** No network at runtime, proven by a test that makes sockets
|
|
75
|
+
raise. Nothing is extracted to disk; a supplier archive does not get to pick a
|
|
76
|
+
path on your filesystem or expand an XML entity.
|
|
77
|
+
- **Rules are data.** [`rules.json`](src/vdi2770_validate/data/rules.json) — each
|
|
78
|
+
rule carries where its requirement comes from, a remedy sentence, and — where the
|
|
79
|
+
reference implementation checks the same thing — the message keys it uses.
|
|
80
|
+
- **22 of 32 rules have a minimal fixture pair** — a container that violates the rule
|
|
81
|
+
and a conforming one differing in as little as a single member. The rest are exercised
|
|
82
|
+
by the vendored corpus. A rule that fires nowhere fails the build.
|
|
83
|
+
- **Rules cannot reach the parser.** A test fails if a rule module imports `zipfile`
|
|
84
|
+
or an XML library, so a rule cannot accidentally check how a document was spelled
|
|
85
|
+
instead of what it says. Rules may name the readers' reserved file names, nothing more.
|
|
86
|
+
|
|
87
|
+
## The classification table, and a disagreement
|
|
88
|
+
|
|
89
|
+
VDI 2770 defines twelve document classes. Two sources publish that table for free —
|
|
90
|
+
IDTA 02004 v2.0.1 Table 1, and the MIT reference implementation. Both renderings of
|
|
91
|
+
every name are stored, so you can check rather than trust: **they agree on all twelve
|
|
92
|
+
German names and disagree on five English ones** (02-03, 02-04, 03-01, 03-04,
|
|
93
|
+
04-01). So matching here is keyed on the class id and the German name, and an
|
|
94
|
+
English name never fails a document — it produces a note that shows both renderings.
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
$ vdi2770-validate classes
|
|
98
|
+
02-03 Bauteile Assemblies [sources disagree]
|
|
99
|
+
IDTA 02004: 'Assemblies' reference impl: 'Components'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Details in [docs/divergences.md](docs/divergences.md).
|
|
103
|
+
|
|
104
|
+
## Licensing
|
|
105
|
+
|
|
106
|
+
Apache-2.0. The VDI 2770 guideline text is sold by DIN Media and was **not** read,
|
|
107
|
+
quoted, or paraphrased. Every rule names its source in `rules.json` instead: the schema
|
|
108
|
+
VDI publishes free, a freely published table, ZIP and XML mechanics, the MIT reference
|
|
109
|
+
implementation (observed there, not verified against the standard), or a judgement of
|
|
110
|
+
our own that has to explain itself.
|
|
111
|
+
See [docs/licensing.md](docs/licensing.md) and [NOTICE](NOTICE).
|
|
112
|
+
|
|
113
|
+
Contributions take a `Signed-off-by` line (DCO).
|
|
114
|
+
|
|
115
|
+
## Related
|
|
116
|
+
|
|
117
|
+
[iirds-validate](https://github.com/dev365code/iirds-validate) — the same idea for
|
|
118
|
+
iiRDS. [standards-watch](https://github.com/dev365code/standards-watch) — a daily
|
|
119
|
+
watch on these standards.
|