This is an exemplary pipeline that returns all courses taught in English from an XML format and transforms them into JSON.
Installed via pyproject.toml using uv:
defusedxml(safely parse XML)pydantic(data validation and serialization)xmltodict(XML-to-JSON conversion)- Other utilities:
bleach,markdownify
-
Install dependencies Ensure Python environment is installed. Run:
uv sync
-
Run the pipeline Execute the shell script:
./whole_pipeline.sh
This:
- Fetches XML data (from
test_SOAP_for_KEU_demo.xml) if it exists (see the note inwhole_pipeline.shto receive the XML file). - Converts XML to an intermediate JSON file (
intermediate.json). - Maps data to KreativEU format.
- Fetches XML data (from
-
Output Intermediate and final JSON files are generated in the working directory.
- Review
whole_pipeline.shfor step-by-step execution details. - Check
src/KreativEU.pyfor course data definition and JSON schema output. - The
xml2json.pyscript handles duplicate entries, sanitizes the XML data and converts it to JSON format. - The
HIS2KEU_mapping.pyscript maps courses to KEU courses.