Skip to main content

XMLtoXSD Library

The xmltoxsd library is a Python tool designed to convert XML documents into XSD (XML Schema Definition) schemas automatically. It simplifies the process of generating XSD schemas from XML files, making it easier for developers to validate their XML data.

Features

  • Automatic Type Inference: Automatically determines the data types for XML elements and attributes.
  • Support for Complex XML Structures: Handles nested elements and attributes with ease.
  • Customizable minOccurs Attribute: Allows users to specify default values for minOccurs attribute in the generated XSD.

Installation

Install xmltoxsd using pip:

pip install xmltoxsd

Quick Start

Here's how to quickly get started with xmltoxsd:

from xmltoxsd import XSDGenerator

generator = XSDGenerator()
xsd_schema = generator.generate_xsd("path/to/your/xml_file.xml")
print(xsd_schema)

Usage

To generate an XSD schema from an XML file:

with open("output.xsd", "w") as f:
    f.write(xsd_schema)

Contributing

We welcome contributions to the xmltoxsd library. Please read our CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you have any questions or encounter issues using the library, please open an issue on my GitHub repository.

Metadata

Release files for xmltoxsd 0.1.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 xmltoxsd 0.1.1
File Size Uploaded
xmltoxsd-0.1.1.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xmltoxsd 0.1.1
File Interpreter ABI Platform
xmltoxsd-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / xmltoxsd-0.1.1.tar.gz

Download URL xmltoxsd-0.1.1.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e713191111c17c2f9b7cde15a47aef8e10a9e3bf4806fbe2d04a3a9f4d746ef4
BLAKE2b-256 checksum
How to use checksums
b0d910cb01b155ccb15808c85cc25696470831912570bf655b78a17d7df8179f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release files / xmltoxsd-0.1.1-py3-none-any.whl

Download URL xmltoxsd-0.1.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bf2cbb7ca0631c7190b6dc4408dfe476d4c0bdadf132bb51fcff20037fb9439
BLAKE2b-256 checksum
How to use checksums
1514ce8fba9a3498c6b76fa99f37c2062b93e406799679f7a4b76e895ca800ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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