data-converter
Python library that loads JSON, JSON5, XML, YAML, or TOML into a dictionary, then writes any of those formats.
Install the lupaxa-data-converter package and import the
lupaxa.data_converter namespace:
from lupaxa.data_converter import DataConverter
payload = {"name": "Lupaxa", "formats": ["json", "json5", "xml", "yaml", "toml"]}
converter = DataConverter(payload, data_type="dict")
print(converter.to_json())
print(converter.to_toml())
data-converter is a library only. There is no console script and no
python -m entry point.
What you get
- Load any supported format into a standard Python dictionary
- Dump that dictionary to JSON, JSON5, XML, YAML, or TOML
- No pairwise converters — two passes through the dict hub
- Python 3.10+, with
PyYAML,defusedxml,json5, andtomli-w
Next steps
- Getting started — install and first conversions
- Usage — load types and conversion methods
- Reference — public API
- Examples — copy-paste recipes