Skip to main content

xsd-to-vol

Tox Code style: black Open Issues Release

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xsd-to-vol 0.0.1
File Size Uploaded
xsd-to-vol-0.0.1.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xsd-to-vol 0.0.1
File Interpreter ABI Platform
xsd_to_vol-0.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 23.2 kB

Release files / xsd-to-vol-0.0.1.tar.gz

Download URL xsd-to-vol-0.0.1.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cf26b296d12caf99f2a3fbe03cddb601374379169f183e94698370f3a4711087
BLAKE2b-256 checksum
How to use checksums
9ae9bb06693f710ed98bd0206309dfab16c01f47cfc8d4d9150032121f448a58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.2

Release files / xsd_to_vol-0.0.1-py2.py3-none-any.whl

Download URL xsd_to_vol-0.0.1-py2.py3-none-any.whl
Size 9.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a4f69b06498dd74ec28d2b435fde20706b26025eeb5cbb1e6834a6253564616b
BLAKE2b-256 checksum
How to use checksums
25a14264a6848e186fa4b5d05c3f22696ec337b10543387182e628d44fe50d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.2

Release history Release notifications | RSS feed

0.0.6

2 release files

0.0.5

2 release files

0.0.2

2 release files

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page