Skip to main content

JSON encoder fully compliant with ECMA-262 specification.

Project description

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

JSON encoder fully compliant with ECMA-262 specification.

Features

Support for all objects that the Python stdlib’s json.JSONEncoder can encode, plus:

  • datetime.datetime

  • datetime.date

  • datetime.time

  • decimal.Decimal

Works on Python 2.6, 2.7, 3.3. Probably works on 3.4 and 3.5 but I haven’t set up tests for those with Tox yet.

Quickstart

Use JSON262Encoder as you would use json.JSONEncoder from the Python standard library:

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

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

History

0.2.0 (2014-05-20)

  • Full implementation with tests.

  • Separate encoders module for encoder functions.

  • Bump to Alpha.

0.1.0 (2014-05-18)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json262-0.2.0.tar.gz (12.3 kB view details)

Uploaded Source

File details

Details for the file json262-0.2.0.tar.gz.

File metadata

  • Download URL: json262-0.2.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for json262-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ba3453bebd413914d10864da2e752d8293c42a4ef52058a13f80afa195716b43
MD5 0977a0085c961a822b3d58889cb04e1b
BLAKE2b-256 c2806e5ff3489a393fde849dffbdebbc942bda87139d051588e20eb8dcaeea8c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page