节俭与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第三方库


热门话题
servlets Java EE+GlassFish:如果用户在其他地方登录,则强制用户注销   java在不更改源代码的情况下添加钩子   安卓 Java TextView Onclick()返回表达式错误   java Excel文件未使用Apache存储内部内存   java getRowCount()和getSelectedColumn()不起作用   无法在java中生成视图绑定。util。Android Gradle插件2.1的NoTouchElementException   Java中的类型转换运算符百分比计算为零   主java中的调用方法   java在Javasound中播放多个示例   java如何知道webDriver成功打开URL   java jmock,每次调用时返回新对象   eclipse使用Java在Selenium WebDriver中生成可执行文件   macos捆绑Java OS X应用程序默认为MacRoman编码   java我应该把我的休息网关变成一个图书馆吗?   java Eclipse插件:查找包含子字符串的行号无效   Java IOException:在Linux上发送UDP数据包时没有可用的缓冲区空间   java无法解析jaxbxjc2中的名称“xjc:globalJavaType”。2.52.罐子   java是否有HibernateAPI来检查是否创建了数据库?