节俭与json的转换

thrift_json的Python项目详细描述


节约json

https://img.shields.io/pypi/v/thrift_json.svghttps://img.shields.io/travis/youngking/thrift_json.svgUpdates

节俭与json之间的转换

  • 自由软件:麻省理工学院许可证

使用量

  • 从json/dict转换为thrift

    >>> from thrift_json import json2thrift, dict2thrift
    >>> thrift_obj = json2thrift(json_str, thrift_class)
    >>> thrift_obj = dict2thrift(dict_obj, thrift_class)
    
  • 从节俭到json/dict的转换

    >>> from thrift_json import thrift2json, thrift2dict
    >>> json_str = thrfit2json(thrift_obj)
    >>> dict_obj = thrift2dict(thrift_obj)
    
  • 直接使用json进行编码/解码

    >>> 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)
    

历史记录

0.1.0(2016-07-11)

  • pypi上的第一个版本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Spark sample()函数是否复制数据?   java如何在API中返回单例列表?   java我可以生成提供输入/输出的哈希函数吗?   如何“使用MATLAB或JAVA”从文本文件中读取数字并将其保存在数组中?   java如何将十进制转换为十六进制?   JavaPostXML文件   java XStream如何在XML中不存在带注释的字段时引发异常   java Tomcat启动批处理问题   java AccessControlException与同一代码库中的小程序类   java如何将长本地时间戳转换为字符串UTC时间戳   java在同一个JavaVM中有多个沙盒   改进LDAP的Java代码   拖放后未附加到DOM的java元素   java通过socket发送压缩数据