跳转到主要内容

完全符合ECMA-262规范的JSON编码器。

项目描述

https://badge.fury.io/py/json262.png https://travis-ci.org/audreyr/json262.png?branch=master https://pypip.in/d/json262/badge.png

完全符合ECMA-262规范的JSON编码器。

功能

支持Python标准库中的< cite>json.JSONEncoder可以编码的所有对象,以及

  • datetime.datetime

  • datetime.date

  • datetime.time

  • decimal.Decimal

在Python 2.6、2.7、3.3上运行。可能在3.4和3.5上也能运行,但我还没有为Tox设置这些测试。

快速入门

就像使用Python标准库中的< cite>json.JSONEncoder一样使用< cite>JSON262Encoder

>>> import datetime
>>> import json
>>> from json262 import JSON262Encoder

>>> json.dumps({'day': datetime.date(2010, 2, 17)}, cls=JSON262Encoder)
'{"day": "2010-02-17"}'

历史

0.2.0 (2014-05-20)

  • 完整的实现和测试。

  • 独立的< cite>encoders模块用于编码函数。

  • 提升到Alpha。

0.1.0 (2014-05-18)

  • 首次在PyPI上发布。

项目详情


下载文件

下载适合您平台的自定义文件。如果您不确定选择哪个,请了解有关安装软件包的更多信息。

源分布

json262-0.2.0.tar.gz (12.3 kB 查看哈希值)

上传时间:

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页