Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Convert many serialization formats to many formats

Project description

https://img.shields.io/pypi/v/roundhouse.svg https://img.shields.io/travis/nick-allen/python-roundhouse.svg Documentation Status

Convert many serialization formats to many formats


Installation

Install CLI bundled with base package

Comes with just JSON and Pickle serializers by default, no external dependencies

pip install roundhouse

Install one or more additional serializers and their dependencies

pip install roundhouse[yaml] roundhouse[msgpack] ...

Or install all builtin serializers and dependencies bundled with core package

pip install roundhouse[all]

Additional serializer plugins can be published and installed via pypi/pip using the roundhouse setuptools entrypoint pointing to module/package containing additional serializer classes

Usage

CLI

The rh CLI command is installed automatically, and defaults to reading from stdin and writing stdout

Run rh --help for full usage instructions

echo '{"root": {"nested": {"key": "value"}}}' | rh -i json -o xml

<?xml version="1.0" encoding="utf-8"?>
<root><nested><key>value</key></nested></root>

Python

Data is serialized/deserialized to and from dict instances

Other data types may be supported depending on the serializer

Use the roundhouse.serialize and roundhouse.deserialize functions with target format

from roundhouse import serialize, deserialize

data = deserialize('{"root": {"nested": {"key": "value"}}}', 'json')
print(serialize(data, 'xml'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
roundhouse-0.2.1-py2.py3-none-any.whl (11.5 kB) Copy SHA256 hash SHA256 Wheel 3.6
roundhouse-0.2.1.tar.gz (14.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page