Skip to main content

A library for converting XML documents to XSD schemas.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmltoxsd-0.1.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

xmltoxsd-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file xmltoxsd-0.1.1.tar.gz.

File metadata

  • Download URL: xmltoxsd-0.1.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for xmltoxsd-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e713191111c17c2f9b7cde15a47aef8e10a9e3bf4806fbe2d04a3a9f4d746ef4
MD5 8ecfc940c0a640658711c548b39a2472
BLAKE2b-256 b0d910cb01b155ccb15808c85cc25696470831912570bf655b78a17d7df8179f

See more details on using hashes here.

File details

Details for the file xmltoxsd-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xmltoxsd-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for xmltoxsd-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7bf2cbb7ca0631c7190b6dc4408dfe476d4c0bdadf132bb51fcff20037fb9439
MD5 cc42683683d2028d48cc3a3614df89d4
BLAKE2b-256 1514ce8fba9a3498c6b76fa99f37c2062b93e406799679f7a4b76e895ca800ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page