Skip to main content

JSON encoder that aims to be fully compliant with specifications ECMA-262 and ECMA-404.

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.3.0 (2014-05-21)

  • Rename package to standardjson.

  • StandardJSONEncoder is now in encoders module.

  • Encoder functions are now in encoder_funcs module.

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

standardjson-0.3.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

standardjson-0.3.0-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file standardjson-0.3.0.tar.gz.

File metadata

File hashes

Hashes for standardjson-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e18aac73328d8de11297e1e1b055960592d05f1b8ad369f9eb6022a7d3821986
MD5 4490b252c935b69dc723d4d4f254c45a
BLAKE2b-256 75b4c1deda93cc6de79cd2d80f747481e3e7d18edc19e69762c62826ebf022ee

See more details on using hashes here.

File details

Details for the file standardjson-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for standardjson-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7f39baf3cf44bfc657bde5fd4f37c5aa533c81be43a8df875733c1b4cecaa424
MD5 9d0a910a20745cc5d9243ac41d8edf22
BLAKE2b-256 f99a262a532f6670da2dfbd8ff886952cf74f3898c5d994238eca37fdd1bb4ad

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