This Python script converts XML files, commonly used in e-shop and merchant online catalogs, into well-organized Excel (XLSX) and CSV files. Designed with ease-of-use in mind, it supports both local file selection and URL-based XML downloads. The script is especially helpful for e-commerce managers, data analysts, and businesses needing quick, reliable XML data conversion.
- Supports local XML files and downloads XML from a URL.
- Customizable output file names.
- Compatible with various main XML tags (product, item, post), or users can input a custom tag if necessary.
- Provides both Excel and CSV output files.
- Python 3.12.5
- Libraries specified in
requirements.txt
- Clone the repository:
git clone https://github.com/apo-veryk/xml-2-exl.git cd xml-2-exl
- Install dependencies:
pip install -r requirements.txt
-
Run the Script Run the script and follow the prompts to select a local XML file or download it from a URL.
python main.py
-
Input Methods
- Choose between a local XML file or enter a URL link when prompted.
- The script will try common XML tags like
<product>
,<item>
, or<post>
but will prompt you to enter a custom tag if none are found automatically.
-
Specify Output File Name
- Enter a desired name for the output files (without extension). The script will save the files in the same directory as the source XML file.
- To make this script an executable (.exe) for easy distribution, you can use PyInstaller:
- Install PyInstaller:
pip install pyinstaller
- Run PyInstaller with the following command:
pyinstaller --onefile --noconsole main.py
- The .exe file will appear in the dist folder. This executable will allow users to run the script without needing Python installed.
- This project is licensed under the MIT License.