standardjson
JSON encoder that aims to be fully compliant with specifications ECMA-262 and ECMA-404.
What it is and what it does
StandardJSON is a JSON encoder that extends Python's standard `json.JSONEncoder` to serialize additional types: `datetime.datetime`, `datetime.date`, `datetime.time`, and `decimal.Decimal` objects. It wraps the stdlib encoder and can be used as a drop-in replacement via the `cls` parameter to `json.dumps()`. The package has no runtime dependencies and installs cleanly as a pure-Python wheel.
The encoder aims for compliance with ECMA-262 and ECMA-404 specifications. However, the project is abandoned—it was released in May 2014 at Alpha status and has not been updated since. The codebase was last touched in December 2022 but no new releases followed. It was only tested on Python 2.6, 2.7, and 3.3; compatibility with modern Python versions remains unverified.
Use it for:
- Serialize Python date and time objects to JSON strings when the standard library encoder rejects them.
- Handle Decimal values in JSON output without converting to float, preserving precision in financial or scientific data.
- Encode mixed data structures containing datetime and numeric types in legacy systems still on older Python versions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a JSON encoder that handles datetime, date, time, and Decimal objects in addition to standard JSON-serializable types, aiming for ECMA-262 and ECMA-404 specification compliance.
No. The package is abandoned and untested on modern Python versions. The standard library's `json` module has evolved, and modern alternatives (or custom encoder functions) are more maintainable. Use only if you are locked into Python 2.6–3.3 and have no other option; otherwise, implement a custom encoder or use a maintained serialization library.
Install
standardjson on PyPI
pip
pip install standardjsonuv
uv add standardjsonpoetry
poetry add standardjsonInstalling standardjson
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last commit was 2022-12-26 and the latest release dates to 2014-05-21. It was marked Alpha at release and has not progressed beyond that status.
License in practice
Licensed under BSD (permissive), so you may use, modify, and distribute it freely with minimal restrictions, though you must include the license notice.
Quickstart
import datetime
import json
from standardjson import StandardJSONEncoder
json.dumps({'day': datetime.date(2010, 2, 17)}, cls=StandardJSONEncoder)
Package targets Python 2.6, 2.7, and 3.3; compatibility with modern Python versions is untested and unsupported.
Verify before relying
- Whether the package actually works on Python 3.4+ as the author suspected but did not formally test.
- Whether ECMA-262 and ECMA-404 compliance claims have been validated against current specification versions.
- Real-world usage patterns and whether the datetime/Decimal serialization format matches expectations in production systems.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,468 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 185,700/month — #10,003 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: standardjson-0.3.1-py2.py3-none-any.whl
Keywords: standardjson
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
json-encoderProvides JSON serialization with…
unclear · top 15,000 on PyPI
demjson3demjson3 encodes, decodes, and validates JSON…
copyleft · top 15,000 on PyPI
numpyencoderProvides a custom JSON encoder class that…
permissive · top 15,000 on PyPI
jsonstreamsWrites JSON documents in a streaming format…
permissive · top 15,000 on PyPI
dynamodb-jsonConverts Python objects to and from DynamoDB's…
unclear · top 5,000 on PyPI
json-numpyProvides lossless JSON encoding and decoding…
permissive · top 15,000 on PyPI
aniso8601Parses ISO 8601 date, time, datetime, duration,…
permissive · top 5,000 on PyPI
orjsonorjson is a fast JSON serialization and…
copyleft · top 1,000 on PyPI
databind.coreDeserializes and serializes Python dataclasses…
permissive · top 15,000 on PyPI
CurrencyConverterConverts currency amounts using historical…
unclear · top 15,000 on PyPI