Tool to convert XML to CSV
- Processes input XML files in chunks
- Extracts specific data from each XML file using XPath expressions
- Writes extracted data to a single CSV file
INPUT_FILE: Path to the input XML dump flat-file. This can be set as environment variable.OUTPUT_FILE: Path to the output CSV fileNAMESPACES: Dictionary mapping namespace prefixes to URIsXPATH_LIST: List of tuples containing XPath expressions and field names
Run the script with UV: uv run main.py or Python: python main.py
Use the following command to test it out:
docker build: docker build --pull --platform linux/amd64 -t xml-to-csv .
docker run: docker run --platform linux/amd64 -v "Your/Local/MountPath":/app/downloads xml-to-csv
example: docker run --platform linux/amd64 -v "/Users/twangchen/Documents/GitHub/xml_to_csv/downloads":/app/downloads xml-to-csv
- Python 3.x
- Polars
- lxml
Only maintained as required.