json-encoder
json encoder uses singledispatch pattern instead of JSONEncoder class overwrites
What it is and what it does
json-encoder is a JSON serialization library that uses Python's singledispatch pattern to register type-specific serializers instead of requiring JSONEncoder subclassing. It eliminates the need to pass a custom encoder class to every json.dumps() call and provides built-in handlers for common types like datetime, UUID, and Decimal. The package is not tied to a specific JSON implementation—it can work with the standard library json module, simplejson, ujson, or others.
The library also converts JSON float numbers to Decimal objects during parsing to avoid floating-point precision issues. Developers can register custom serializers for their own types using a simple decorator pattern. However, the package has been abandoned since 2016-09-16 and receives no maintenance, making it a legacy tool that may not work reliably with current Python versions or modern JSON libraries.
Use it for:
- Serialize datetime, date, time, UUID, and Decimal objects to JSON without writing custom encoder classes.
- Register custom serializers for domain-specific types using a decorator pattern instead of subclassing JSONEncoder.
- Switch between json, simplejson, or ujson implementations globally or per-call without changing serialization logic.
- Prevent floating-point precision loss by parsing JSON numbers as Decimal objects.
- Avoid repeating cls=MyEncoder in every json.dumps() call across a codebase.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides JSON serialization with singledispatch-based type handlers instead of JSONEncoder subclassing, with built-in support for time, date, datetime, UUID, and Decimal types.
No. The package is abandoned (last release 2016-09-16) with no maintenance signal, an unclear license, and compatibility only documented through Python 3.5. Modern Python versions and current JSON libraries may not work with it. For new projects, use a maintained alternative or the standard library's JSONEncoder with custom handlers. For legacy codebases already using it, consider migrating.
Install
json-encoder on PyPI
pip
pip install json-encoderuv
uv add json-encoderpoetry
poetry add json-encoderInstalling json-encoder
Before you install
Low install friction with only two runtime dependencies (six and singledispatch). However, the package is abandoned—last release was 2016-09-16, with no maintenance activity since.
License in practice
License status is unclear; no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before use in proprietary or copyleft-sensitive projects.
Quickstart
from json_encoder import json
result = json.dumps(data)
# Register custom type handler:
from json_encoder.encoder import json_encoder
@json_encoder.register(MyType)
def encode_mytype(obj):
return str(obj)
singledispatch is a runtime dependency; for Python < 3.4, singledispatch >= 3.4.0.3 must be installed separately.
Verify before relying
- Whether the package is compatible with modern Python versions beyond 3.5 (last tested version in classifiers).
- Current state of the repository and whether it has been archived or deleted.
- Whether the unclear license is permissive or restrictive, and what the actual license text is.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — six, singledispatch |
| Maintenance | abandoned — 3,619 days since the last release |
| First released | |
| Downloads | 82,638/month — #14,149 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: json_encoder-0.4.4-py2.py3-none-any.whl
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
dynamodb-jsonConverts Python objects to and from DynamoDB's…
unclear · top 5,000 on PyPI
standardjsonProvides a JSON encoder that handles datetime,…
permissive · top 15,000 on PyPI
simplejsonsimplejson encodes Python objects to JSON and…
permissive · top 1,000 on PyPI
jsonconversionConverts arbitrary Python objects to JSON…
permissive · top 5,000 on PyPI
ujsonUltra-fast JSON encoding and decoding in pure C…
permissive · top 1,000 on PyPI
numpyencoderProvides a custom JSON encoder class that…
permissive · top 15,000 on PyPI
canonicaljsonEncodes Python objects to canonical JSON with…
permissive · top 15,000 on PyPI
json-fixPatches Python's built-in `json` module to…
permissive · top 15,000 on PyPI
json-tricksExtends Python's JSON serialization to handle…
permissive · top 15,000 on PyPI
methoddispatchAdds single-dispatch method support to Python…
permissive · top 15,000 on PyPI