A library that allows custom JSON serialization for any class by adding a __json__ method, seamlessly patching the built-in json module. Current version 1.0.2, updated periodically.
pip install json-fixVerified import paths — ran on the pinned version, not inferred.
Imports json_fix to patch json module, then defines a class with __json__ method for custom serialization.
Ensure no other code depends on json raising TypeError for custom objects without __json__.
Return a native Python object (e.g., dict) from __json__; do not call json.dumps inside it.
Use built-in json module for serialization when using json_fix.
Add 'import json_fix' at the top of your script and define a __json__ method on your class that returns a serializable object.
Run 'pip install json-fix' to install the package.
No dependency data recorded yet.