--- id: jsonconversion version: "1.2.1" license: BSD license_treatment: permissive maintenance: aging --- # jsonconversion — This python module helps converting arbitrary Python objects into JSON strings and back. License: permissive · Maintenance: aging · Downloads: 14.1M/mo ## 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 above — 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 pip install jsonconversion uv add jsonconversion poetry add jsonconversion ## Installing 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_current - Install friction: low - Maintenance: aging - Downloads: 14.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags json serialization custom objects, python object to json conversion, json encoder decoder numpy, serialize arbitrary python classes, json with custom type support, serialization, json-encoding [View on SkillFed](https://skillfed.io/packages/jsonconversion) · [View on PyPI](https://pypi.org/project/jsonconversion/)