Skip to main content

converter between thrift and json

Project description

thrift_json

https://img.shields.io/pypi/v/thrift_json.svg https://img.shields.io/travis/youngking/thrift_json.svg Updates

converter between thrift and json

  • Free software: MIT license

Usage

  • convert from json/dict to thrift

    >>> from thrift_json import json2thrift, dict2thrift
    >>> thrift_obj = json2thrift(json_str, thrift_class)
    >>> thrift_obj = dict2thrift(dict_obj, thrift_class)
    
  • convert from thrift to json/dict

    >>> from thrift_json import thrift2json, thrift2dict
    >>> json_str = thrfit2json(thrift_obj)
    >>> dict_obj = thrift2dict(thrift_obj)
    
  • encode/decode use json directly

    >>> from thrift_json import ThriftJSONEncoder
    >>> json_str = json.dumps(thrift_obj, cls=ThriftJSONEncoder)
    
    >>> from thrift_json import ThriftJSONDecoder
    >>> thrift_obj = json.loads(json_str, cls=ThriftJSONDecoder, thrift_class=thrift_class)
    

History

0.1.0 (2016-07-11)

  • First release on PyPI.

Project details


Release history Release notifications

Download files

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

Files for thrift_json, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size thrift_json-0.1.0.tar.gz (16.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page