包装安装的最好的json,返回到内部simplejson。

omnijson的Python项目详细描述


问题

# Python 2.5.4 (r254:67916, Jun 24 2010, 21:47:25)
>>> import anyjson
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    raise ImportError("No supported JSON module found")
ImportError: No supported JSON module found

解决方案

>>> import omnijson as json
# \o/

功能

  • 加载安装最快的json模块
  • 回到纯python simplejson中构建,以防万一。
  • 正确的api(loads()dumps()
  • 可春化
  • 支持python 2.5-3.2开箱即用

用法

加载可用的最佳json:

import omnijson as json

转储一些对象:

>>> json.loads('{"yo": "dawg"}')
{'yo': 'dawg'}

加载一些对象:

>>> json.dumps({'yo': 'dawg'})
'{"yo": "dawg"}'

检查json引擎:

>>> json.engine
'ujson'

安装

安装omnijson很容易:

$ pip install omnijson

的,如果必须的话:

$ easy_install omnijson

但是,你really shouldn’t do that

许可证

麻省理工学院的执照:

Copyright (c) 2011 Kenneth Reitz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

推荐PyPI第三方库


热门话题
javajavax。艾尔。PropertyNotFoundException:   java为什么通过TCP发送的文件比它本身包含的文件包含更多的数据?   java为什么字符开关/案例不起作用?   php到java连接器,在哪里可以找到好的连接器   需要帮助Java简单规则形状面积计算器和if语句吗   macos如何从newstyle Oracle Java OSX捆绑包结构启动帮助页?   java既然所有的类都扩展对象,而对象是一个类,那么对象如何扩展对象呢?   java从JavaPairdd<String,Tuple2<Integer,Integer>>转换为JavaPairdd<String,Integer>   java微调器值未从一个活动传递到另一个活动   参数化类型的java数组   java不提供类。getCanonicalName是否存在性能问题?   java输入键JTextField   为什么我不能在java中调用nextLine()方法两次?   JTextPane中的java JProgressBar   java如何获取Crudepository实例?   用于提取几个<div>标记的java正则表达式   java如何使用JUnit Testrunner生成html图像   Go中Java静态属性的等价性