By the end of this guide you will have kimera-core installed, a working in-memory cache storing and retrieving a Python dictionary with TTL expiry, aDocumentation 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.
KimeraSerializer round-tripping a complex object that contains a datetime and a tuple, and a deterministic MD5 hash key generated from a plain dict — all with real, runnable code drawn directly from the library’s source.
Install kimera-core
Install the package from PyPI using pip. No extra flags or indexes are required for the core feature set.After installation completes, you can verify it by opening a Python shell and importing one of the engines — see the Verify Installation section for a one-liner check.
Use the in-memory cache
InMemoryCacheEngine stores key-value pairs in a plain Python dict inside your process. Every entry carries a TTL (time-to-live) in seconds; once the TTL elapses, get and exists treat the entry as absent. The engine also enforces a maximum number of entries via size_regulator, evicting the oldest item when the limit is breached.timeout parameter is expressed in seconds and defaults to 300.0 when omitted. The size parameter defaults to 300 entries. Both defaults are defined as class-level constants on BaseCacheEngine.Serialize a Python object
KimeraSerializer performs round-trip JSON serialization for Python types that the standard json module cannot handle natively, including datetime, date, tuple, and nested combinations. It selects the correct handler automatically by inspecting the object’s type.serialize method returns a JSON string. The deserialize method reconstructs the original Python object, including the correct types — the datetime comes back as a datetime instance, and the tuple comes back as a tuple.Hash an object
build_hash creates a deterministic MD5 hex digest from any Python object by encoding both its string representation and its type. The same object always produces the same hash, making it safe to use as a cache key.hashlib.md5(str(obj).encode() + str(type(obj)).encode()).hexdigest(). Because the type is included in the digest, a string "1" and an integer 1 produce different hashes even though their string representations are identical.The import paths above — such as
components.storage.dynamic.cache.local.engines — assume you are running Python from within the kimera-core package directory (i.e., the directory that contains the components/ folder). If you have installed the package into a virtualenv via pip and the package registers its own top-level namespace, adjust the import path to match your environment.