Kimera Core is a lightweight Python utility library designed to eliminate repetitive boilerplate when building production-grade applications. It ships a cohesive set of components — in-memory and thread-local caching, smart JSON serialization, MD5 hashing, a Logstash-compatible logging handler, and module introspection — so you can focus on your domain logic instead of reinventing infrastructure primitives. It targets Python 3.6 and above, carries no mandatory third-party dependencies, and is straightforward to extend thanks to its abstract-base-class architecture.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.
Architecture
Every Kimera Core component is rooted in an abstract base class (ABC), which guarantees a consistent interface and lets you swap or extend any engine without changing the calling code. The cache subsystem exposes a three-level hierarchy:| Class | Type | Responsibility |
|---|---|---|
BaseCacheEngine | ABC | Declares the core contract: get, set, delete, exists, clear |
LocalCacheEngine | ABC (extends BaseCacheEngine) | Adds normalize_timeout, normalize_size, and the abstract size_regulator |
InMemoryCacheEngine | Concrete | Process-wide dict-backed store with TTL and size eviction |
ThreadCacheEngine | Concrete | Per-thread store — isolates cache state across threads automatically |
BaseSerializerHandler (ABC) defines can_i_handle_object_to_serialize, can_i_handle_object_to_deserialize, build_serializer, and build_deserializer. Concrete handlers (DictSerializerHandler, DateTimeSerializerHandler, TupleSerializerHandler, and others) are composed inside KimeraSerializer, which selects the right handler at runtime for any Python object.
Because all engines inherit from ABCs, you can introduce a custom cache backend — say a file-based store or a cloud key-value service — by subclassing
LocalCacheEngine and implementing its abstract methods. The rest of your application needs no changes.Components
Local Cache
In-memory and thread-local cache engines with TTL and configurable max-size eviction.
Remote Cache
Redis and Memcached backends sharing the same
BaseCacheEngine interface.Serializers
Round-trip JSON serialization for dicts, lists, tuples,
datetime, date, and arbitrary Python objects.Extractor
Raw data extraction utilities for pulling structured content from unstructured sources.
Utilities
Hash
build_hash produces a deterministic MD5 hex string from any Python object, including custom class instances.Import Utils
Runtime module introspection: check existence, resolve fully qualified names, and retrieve attributes dynamically.
Exceptions
ExceptionsUtils provides guard helpers, such as raising on missing dictionary keys, that keep validation logic concise.Logger
KimeraLogstashHandler extends Python’s DatagramHandler to serialise log records as UTF-8 strings and forward them to a Logstash UDP endpoint.Python Version Compatibility
Kimera Core requires Python 3.6 or later. The minimum version is enforced insetup.py via python_requires='>=3.6'. All standard-library features used — abc, threading, hashlib, json, importlib — are available in every supported release.
License
Kimera Core is released under the MIT License. You are free to use, modify, and distribute it in both open-source and commercial projects. See theLICENSE file at the root of the repository for the full license text.