Converts Environment and Climate Change Canada's SWOB-ML XML files to JSON.
SWOB is Surface Weather and Marine Observation Markup Language, the format is described in docs here
- Create a new python environment if required. eg
python -m venv venv && source venv/bin/activate
pip install --upgrade https://github.com/cioos-siooc/swob_to_json/tarball/main
- python -m swob_to_json /test_files/input_xml/2023-02-01-0615-46036-AUTO-swob.xml
- See example output file - /test_files/output_json/2023-02-01-0615-46036-AUTO-swob.xml.json
from swob_to_json import swob_to_json
swob_json = swob_to_json.parseFile(filename)
# or
swob_json = swob_to_json.parseText(xml_string)