New in version 1.1.1.
Tools for using Python’s json module with MongoDB documents.
This module provides two methods: object_hook and default. These names are pretty terrible, but match the names used in Python’s json library. They allow for specialized encoding and decoding of MongoDB documents into Mongo Extended JSON‘s Strict mode. This lets you encode / decode MongoDB documents to JSON even when they use special PyMongo types.
Example usage (serialization):
>>> json.dumps(..., default=json_util.default)
Example usage (deserialization):
>>> json.loads(..., object_hook=json_util.object_hook)
Changed in version 1.2: Added support for encoding/decoding datetimes and regular expressions.