节俭与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中的安卓字节[]操作   java如何使用SeleniumWebDriver自动弹出对话框窗口   运行单黄瓜JVM的java。来自Gradle的功能文件   在Java中使用JTA连接到SSH   eclipse为什么在从SVN签出Ant版本1.3时,Ant java项目本身有很多错误?   java如何获取撇号之间的字符串   java锁在单个线程上作为布尔信号量工作吗?   bluej我可以使用什么代码清除屏幕(java)?   java在单击JButton时更改JPanel图标   java将逗号分隔的字符串转换为不带中间容器的列表   java Flink:以集群模式加载资源文件   java删除多对多条目,同时将两个对象都保留在数据库中   将数组值向左移动