xsd-to-vol
Convert XML Schema Definition files to voluptuous schemas.
Binary file usage
Basic usage:
xml-to-vol -i schema.xsd -o schema.py
Basic pipe usage:
cat schema.xsd | xml-to-vol > schema.py
Pipe through black formatter:
cat schema.xsd | xsd-to-vol | black - > schema.py
Advanced piping example with curl:
curl -s https://api-test.geofox.de/gti/public/geofoxThinInterfacePublic.xsd 2>&1 | xsd-to-vol | black - > schema.py
You can also mix input/output files and stdin/stdout.
Library usage
You can also use the xml_to_vol method to convert your schema:
from xsd_to_vol import xsd_to_vol
with open("schema.xsd", 'r') as schema_file:
xsd = schema_file.read()
print(xsd_to_vol(xsd))
To Do
While the generation should work for most xsd files, there are some features I'd like to have in future versions:
- Only include used imports: Currently all possible voluptuous requirements are imported. The required imports can be determined.
- Tests: Gather different xsd schemas and build pytests to test the generation.
- Automatic code formatting: Run black over the code (without piping).
Contributions are welcome!
If you want to contribute to this, please read the Contribution guidelines
Release files for xsd-to-vol 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xsd-to-vol-0.0.6.tar.gz | 14.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xsd_to_vol-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.3 kB
Release files / xsd-to-vol-0.0.6.tar.gz
| Download URL | xsd-to-vol-0.0.6.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
205c1578630a15ff847b91ea88d1eeb3782a987f16b3fd19b6def39b196d063f
|
|
BLAKE2b-256 checksum How to use checksums |
9e71e144f8a6fd67a6c548ae0e00bfccd29166e647e15af093b1e0ac64631e75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Release files / xsd_to_vol-0.0.6-py3-none-any.whl
| Download URL | xsd_to_vol-0.0.6-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85ef305dcd81630d763432cafcd6e9fb03d5002c2bf33dc53e8f9c033f04537c
|
|
BLAKE2b-256 checksum How to use checksums |
d3afeb9d2c558906e36fac27b62826f86962d4e58928a4b88d34cb9213770236
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|