xsd2xml is a simple Python tool that converts an XSD schema file into a structured XML file. Built for developers who need to generate XML files quickly from existing schemas, it automates the process and reduces manual work.
- Generate XML files from XSD schema files
- Lightweight and easy to use, uses only
xmlschemaandxml.etree - Available as a local wheel package for now
- Python 3.10+ compatible
- Future support for PyPI upload
- Add more docstring to the project
- pylint compliance
- Add release workflow
- Implement more tests
At the moment, xsd2xml is available only as a locally-built wheel package. Here's how you can install it:
-
Clone the repository:
git clone https://github.com/Tommac1/xsd2xml.git
-
Navigate to the project directory:
cd xsd2xml -
Build the wheel package:
pip install -r requirements-dev.txt python -m build
-
Install the package locally:
pip install dist/*.whl
You can generate an XML file from an XSD schema using the command line:
xsd2xml xsd_path xml_pathOr you can use it in your source code:
📝 If you only intend to use it as a source code, installing
requirements.txtis enough. 📝
from xsd2xml import xsd2xml
xml_gen = xsd2xml.Xsd2Xml('my_schema.xsd')
xml_gen.gen_xml()
xml_gen.save_xml('my_output.xml')To run tests, simply type in root directory:
pytestWe welcome contributions to xsd2xml! To keep the codebase clean and maintainable, we ask all contributors to follow a few guidelines before submitting their pull requests:
-
PEP8 Compliance 🐍:
- All code must adhere to PEP8, the Python style guide.
- You can check your code using:
flake8 your_module.py
-
Unit Tests ✅:
- Ensure your changes are fully covered by tests.
- Run all tests to make sure nothing breaks:
pytest
-
Pre-Commit Hooks 🔧:
- We use pre-commit to automatically check code formatting and linting before committing. Make sure you install the hooks locally:
pre-commit install
- Run the pre-commit checks manually before committing:
pre-commit run --all-files
- We use pre-commit to automatically check code formatting and linting before committing. Make sure you install the hooks locally:
-
Fork the repository and create your feature branch:
git checkout -b feature/new-feature
-
Make sure your code passes all checks (PEP8, unit tests, pre-commit hooks).
-
Submit a pull request with a detailed description of your changes.
For donations, we encourage you to support a local charity or animal shelter. Your help can make a difference in someone's life or provide care for animals in need. ❤️
If you would still like to contribute to the project in some other way, feel free to reach out or let us know. We’re always happy to hear from you!
Thank you for using xsd2xml! We hope it simplifies your XML generation process.