Skip to content

Commit

Permalink
Add generated XML bindings for some schemata
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Nov 14, 2023
1 parent e7a7da4 commit 3f38192
Show file tree
Hide file tree
Showing 16 changed files with 7,851 additions and 1 deletion.
37 changes: 37 additions & 0 deletions external-schemata/.xsdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<Config xmlns="http://pypi.org/project/xsdata" version="23.8">
<Output maxLineLength="79" subscriptableTypes="false" unionType="false">
<Package>generated</Package>
<Format repr="true" eq="true" order="false" unsafeHash="false" frozen="true" slots="false" kwOnly="false">dataclasses</Format>
<Structure>filenames</Structure>
<!-- not public API; the applicable standards is the documentation, so no docstrings to reduce noise -->
<DocstringStyle>Blank</DocstringStyle>
<FilterStrategy>allGlobals</FilterStrategy>
<RelativeImports>true</RelativeImports>
<CompoundFields defaultName="choice" forceDefaultName="false">false</CompoundFields>
<PostponedAnnotations>false</PostponedAnnotations>
<UnnestClasses>false</UnnestClasses>
<IgnorePatterns>false</IgnorePatterns>
<IncludeHeader>false</IncludeHeader>
</Output>
<Conventions>
<ClassName case="mixedPascalCase" safePrefix="type"/>
<FieldName case="snakeCase" safePrefix="value"/>
<ConstantName case="screamingSnakeCase" safePrefix="value"/>
<ModuleName case="snakeCase" safePrefix="mod"/>
<PackageName case="snakeCase" safePrefix="pkg"/>
</Conventions>
<Substitutions>
<Substitution type="package" search="http://www.w3.org/2001/XMLSchema" replace="xs"/>
<Substitution type="package" search="http://www.w3.org/XML/1998/namespace" replace="xml"/>
<Substitution type="package" search="http://www.w3.org/2001/XMLSchema-instance" replace="xsi"/>
<Substitution type="package" search="http://www.w3.org/1998/Math/MathML" replace="mathml3"/>
<Substitution type="package" search="http://www.w3.org/1999/xlink" replace="xlink"/>
<Substitution type="package" search="http://www.w3.org/1999/xhtml" replace="xhtml"/>
<Substitution type="package" search="http://schemas.xmlsoap.org/wsdl/soap/" replace="soap"/>
<Substitution type="package" search="http://schemas.xmlsoap.org/wsdl/soap12/" replace="soap12"/>
<Substitution type="package" search="http://schemas.xmlsoap.org/soap/envelope/" replace="soapenv"/>
<Substitution type="class" search="(.*)Class$" replace="\1Type"/>
</Substitutions>
<Extensions/>
</Config>
10 changes: 10 additions & 0 deletions external-schemata/CODEGEN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Code generation from XSD data files is handled by `xsdata`.
The version of `xsdata` used to generate these files should be kept in
sync with the version in `pyproject.toml` to ensure compatibility,
and to keep the cumulative maintenance burden for `xsdata` upgrades low.

Generated APIs are not part of pyHanko's public API for the purposes
of semver, and hence care should be exercised not to expose generated
types in public API signatures.

Always generate code by running `genxml.sh` from the project's root directory.
9 changes: 9 additions & 0 deletions external-schemata/genxml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
xsdata generate \
--config ./external-schemata/.xsdata.xml \
-p pyhanko.generated \
--recursive \
./external-schemata/xsd/

isort --profile black --line-length 80 pyhanko/generated
black -S --line-length 80 pyhanko/generated
624 changes: 624 additions & 0 deletions external-schemata/xsd/etsi/ts_11910202.xsd

Large diffs are not rendered by default.

457 changes: 457 additions & 0 deletions external-schemata/xsd/etsi/ts_119612.xsd

Large diffs are not rendered by default.

Loading

0 comments on commit 3f38192

Please sign in to comment.