Skip to content

264768502/xmltojson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xmltojson


Python library and cli tool for converting XML to JSON

Downloads

Install

$ poetry add xmltojson

$ pip install xmltojson

Usage

Command line:

Converting an XML file and sending the output to STDOUT

$ xmltojson <filename.xml>

Send output to a file

$ xmltojson <filename.xml> -o <new_filename.json>

xmltojson can also read from STDIN

$ echo '<name>John</name>' | xmltojson --stdin

Library:

[1]: import xmltojson
[2]: with open('/path/to/file', 'r') as f:
...:     my_xml = f.read()
[3]: xmltojson.parse(my_xml)
'{"name": "John"}'

About

Cli tool and Python module to convert XML to JSON

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%