Serialization is the process of converting a live, in-memory Python object into a portable representation — a byte stream or a string — that can be written to disk, stored in a database, or sent across a network. The reverse operation, reconstructing the original object from that representation, is called deserialization (or unmarshalling). Together, these two operations are the backbone of persistence and inter-process communication in virtually every modern application.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ismael-sarmiento/kimera_python/llms.txt
Use this file to discover all available pages before exploring further.
Why Serialization Matters
Serialization is more than a convenience for network programming. Many everyday operations depend on it, and most major languages — C, C++, Java, C#, Python, and Perl among them — ship standard-library support for it precisely because the use cases are so pervasive.Storage and Databases
Serialized objects can be written to any storage medium — a local disk, a relational database BLOB column, or an object store — and later reloaded exactly as they were.
Network Transport
Converting an object to bytes makes it possible to transmit application state over TCP/IP, HTTP, or message queues to a completely different host.
Remote Procedure Calls
RPC frameworks rely on serialization to pack arguments into a wire format, ship them to a remote process, and unpack the return value on the caller’s side.
Crash Recovery
A running program can periodically serialize its state to disk. If it crashes, it reloads from the most recent snapshot instead of starting from zero.
Object Interchange
Serialized data can be consumed by independent programs written in different languages, as long as both sides agree on the format.
Change Detection
Comparing serialized snapshots taken at different points in time makes it straightforward to detect which fields of an object changed during execution.
One of serialization’s most powerful properties is architecture independence: a well-chosen format lets objects serialized on a 64-bit ARM server be deserialized on an x86 laptop — or even in a browser — without any special handling.
Serialization in Kimera Core
Kimera Core ships two serializer implementations, each optimized for a different class of use case.- KimeraSerializer (JSON)
- Pickle (Binary)
KimeraSerializer is a JSON-based serializer that handles Python’s built-in types — str, int, float, list, tuple, dict, datetime, and date — through a chain of specialized handler classes (DateSerializerHandler, ListSerializerHandler, DictSerializerHandler, and so on). Each handler knows how to both serialize and deserialize exactly one type family, and KimeraSerializer selects the right one automatically.- Sending objects over HTTP APIs or message queues
- Storing structured data in a relational or document database
- Cross-language or cross-service data exchange (the output is plain JSON)
- Any situation where a human-readable or inspectable wire format matters
Marshalling vs Serialization
The two terms are frequently used interchangeably in Python, but they carry different meanings in other ecosystems.The distinction explained
The distinction explained
In Java, marshalling means storing an object’s state and its class code together, so the receiving side can reconstruct the object even without having the class definition locally. Serialization in Java only captures object state — the class must already be available on the other end.In Python, the distinction does not exist at the language level.
pickle, json, marshal, and third-party libraries all follow roughly the same model: capture state, transmit or store it, reconstruct on the other side. The word marshalling in Python documentation typically refers to converting arguments for C extension calls, not to any broader concept of bundling code with data.For practical purposes in a Kimera Core project, treat the terms as synonyms unless you are integrating with a Java or .NET system that uses Java’s stricter definition.Serializers Reference
Full API reference for
KimeraSerializer, Pickle, and all BaseSerializerHandler subclasses — including handler registration, custom type support, and usage examples.