jsonconversion
This python module helps converting arbitrary Python objects into JSON strings and back.
What it is and what it does
jsonconversion extends Python's built-in json module to serialize and deserialize arbitrary Python objects, including custom classes, builtins (int, float, str, list, set, dict, tuple), type objects, and numpy arrays. It works by storing class metadata in the JSON output so objects can be reconstructed on deserialization.
To use it with your own classes, you inherit from JSONObject and implement to_dict and from_dict methods that define which attributes to serialize. The package handles the rest—encoding to JSON strings via JSONObjectEncoder and decoding back via JSONObjectDecoder. It's designed for scenarios where you need to persist complex Python object hierarchies as JSON, such as in web frameworks (Django, Flask) or scientific workflows.
Use it for:
- Serialize custom Python classes to JSON for storage or transmission in web applications.
- Round-trip complex nested data structures (objects containing other objects) to and from JSON.
- Store scientific or numerical data with custom metadata by combining numpy arrays with JSONObject subclasses.
- Migrate serialized objects when class module paths change using the substitute_modules parameter.
- Extend JSON encoding for domain-specific types without modifying the standard json module.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts arbitrary Python objects to JSON strings and back, extending the standard json module with support for custom classes, numpy arrays, and nested structures through JSONEncoder and JSONDecoder subclasses.
Yes, if you need to serialize custom Python objects to JSON beyond what the standard json module supports. The package is stable (Production/Stable status), has no known vulnerabilities, and carries a permissive license. Install friction is low. However, maintenance is aging (last release 275 days ago), so verify that its feature set meets your needs before adopting it for new projects.
Install
jsonconversion on PyPI
pip
pip install jsonconversionuv
uv add jsonconversionpoetry
poetry add jsonconversionInstalling jsonconversion
Before you install
Low install friction with a pure-wheel distribution. Maintenance is aging—last release 275 days ago—but the repository remains active and unarchived with recent commits.
License in practice
BSD license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you retain the license notice.
Quickstart
import json
from jsonconversion.encoder import JSONObjectEncoder
from jsonconversion.decoder import JSONObjectDecoder
var = (1, 2, 3)
str_var = json.dumps(var, cls=JSONObjectEncoder)
var_2 = json.loads(str_var, cls=JSONObjectDecoder)
assert var == var_2
Requires Python 3.9 or later; numpy is a runtime dependency.
Verify before relying
- Whether numpy array serialization is fully documented or tested in the current release.
- Performance characteristics when serializing deeply nested or very large object graphs.
- Compatibility guarantees with recent Python 3.x minor versions beyond 3.9.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | aging — 275 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 14,088,461/month — #1,247 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonconversion-1.2.1-py3-none-any.whl
Keywords: json, conversion, serialization
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
json-fixPatches Python's built-in `json` module to…
permissive · top 15,000 on PyPI
json-numpyProvides lossless JSON encoding and decoding…
permissive · top 15,000 on PyPI
jsonobjectjsonobject provides a Python library for…
permissive · top 15,000 on PyPI
simplejsonsimplejson encodes Python objects to JSON and…
permissive · top 1,000 on PyPI
json-encoderProvides JSON serialization with…
unclear · top 15,000 on PyPI
json5Parses and writes JSON5 data format, which…
permissive · top 1,000 on PyPI
yamlableConverts Python objects to YAML and back using…
permissive · top 15,000 on PyPI
numpyencoderProvides a custom JSON encoder class that…
permissive · top 15,000 on PyPI
json-tricksExtends Python's JSON serialization to handle…
permissive · top 15,000 on PyPI
pysubtypesProvides enhanced subclasses for Python…
permissive · top 15,000 on PyPI