Tag

custom-encoder

1 views collected around this technical thread.

Test Development Learning Exchange
Test Development Learning Exchange
May 11, 2025 · Backend Development

Using the default Parameter in Python's json Module for Custom Serialization

This article explains how the json module's default parameter can be used to serialize unsupported Python objects, such as datetime, by providing a custom function or by subclassing JSONEncoder, and includes clear code examples demonstrating both approaches.

DateTimeJSONPython
0 likes · 4 min read
Using the default Parameter in Python's json Module for Custom Serialization
Test Development Learning Exchange
Test Development Learning Exchange
Aug 9, 2024 · Backend Development

Custom JSON Encoder and Advanced Serialization Techniques in Python

This article demonstrates how to create custom JSON encoders, serialize and deserialize custom classes, handle circular references, and use various json.dumps parameters such as default, object_pairs_hook, allow_nan, indent, separators, and ensure_ascii to control JSON output in Python.

Serializationcustom-encoderdeserialization
0 likes · 7 min read
Custom JSON Encoder and Advanced Serialization Techniques in Python