Metadata-Version: 2.1
Name: xmltojson
Version: 2.0.2
Summary: A Python module and cli tool to quickly convert xml text or files into json
Home-page: https://github.com/shanahanjrs/xmltojson
License: Apache-2.0
Keywords: json,xml,convert,converter,library
Author: John Shanahan
Author-email: shanahan.jrs@gmail.com
Maintainer: John Shanahan
Maintainer-email: shanahan.jrs@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: Markup :: XML
Requires-Dist: xmltodict (>=0.12.0,<0.13.0)
Project-URL: Repository, https://github.com/shanahanjrs/xmltojson
Description-Content-Type: text/markdown

# xmltojson

---

Python library and cli tool for converting XML to JSON

[![Downloads](https://static.pepy.tech/personalized-badge/xmltojson?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Installs)](https://pepy.tech/project/xmltojson)

## 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"}'
```

