https://github.com/halukyamaner/xml-to-json
XML to JSON
https://github.com/halukyamaner/xml-to-json
json python xml xml-parser
Last synced: 3 months ago
JSON representation
XML to JSON
- Host: GitHub
- URL: https://github.com/halukyamaner/xml-to-json
- Owner: halukyamaner
- Created: 2024-09-05T09:24:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T09:28:34.000Z (almost 2 years ago)
- Last Synced: 2025-01-18T02:28:02.214Z (over 1 year ago)
- Topics: json, python, xml, xml-parser
- Language: Python
- Homepage: https://www.halukyamaner.com/contact
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XML to JSON
## Overview
The XML to JSON is a Python utility designed to convert XML files into JSON format. This tool parses an XML file and transforms it into a structured JSON document, preserving the hierarchical relationship of the XML elements.
## Features
- **XML Parsing**: Efficiently parses XML data and extracts attributes, tags, and text.
- **JSON Conversion**: Converts the parsed XML data into a well-structured JSON format.
- **File Handling**: Allows users to specify both the source XML file and the destination JSON file through the command line.
## Requirements
- Python 3.x
- `xml.etree.ElementTree` module for XML parsing
- `json` module for JSON formatting
## Usage
To convert an XML file to JSON, run the script from the command line. You will be prompted to enter the path of the XML file and the desired name for the resulting JSON file.
```bash
python xml_to_json.py