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
Metadata
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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xsd-to-vol-0.0.1.tar.gz | 13.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xsd_to_vol-0.0.1-py2.py3-none-any.whl | Python 3, Python 2 | 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
|
Security for xsd-to-vol 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.