Python 3 script to flatten an XSD schema into a single document by merging all included schemas. The flattened schema is printed to the console.
Install directly from source:
pip3 install .Or for development:
pip3 install -e .After installation, you can use the xsdflatten command directly.
If installing manually, install dependencies using:
pip3 install -r requirements.txtAfter installation via pip:
xsdflatten input_schema.xsd
xsdflatten --output flattened.xsd input_schema.xsdOr run directly without installation:
python3 xsdflatten.py input_schema.xsd
python3 xsdflatten.py --output flattened.xsd input_schema.xsdinput_file- Input XSD file to flatten (required)-o, --output FILE- Output file (if not specified, prints to stdout)-h, --help- Show help message
The script processes the main XSD file and all its includes (recursively), then outputs a single flattened XSD schema. Use -o parameter to save to a file or redirect stdout with >.
This project is based on the original tool esunder/xsdflatten and is further developed and extended.