custom_json_factory#
- gufe.custom_json.custom_json_factory(coding_methods: Iterable[JSONCodec]) tuple[type[JSONEncoder], type[JSONDecoder]]#
Create JSONEncoder/JSONDecoder for special types.
Factory method. Dynamically creates classes that enable all the provided
coding_methods. Returns classes, not instances, as classes are used by theclsargument injson.loads/json.dumps.- Parameters:
coding_methods (Iterable[JSONCodec]) – codecs to use
- Returns:
subclasses of JSONEncoder/JSONDecoder that use support the provided codecs
- Return type:
Tuple[Type[JSONEncoder], Type[JSONDecoder]]