Cachy provides a simple yet effective caching library for Python. It offers a powerful and thread-safe API with decorator syntax and supports various backend stores including memcached, Redis, database, file system, and in-memory dictionaries. The current stable version is 0.3.0, released in 2019.
pip install cachyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure and use Cachy with a file-based store. It shows how to put, retrieve, and check for items in the cache. An example for a Redis store is also included (commented out), highlighting the need for external service configuration.
Ensure your Python environment is version 2.7+ or 3.4+.
Evaluate against your project's longevity and maintenance requirements. Consider alternatives if active support or newer Python version compatibility (beyond the declared `requires_python`) is critical.
Install the necessary client libraries for your chosen cache store (`pip install redis` for Redis, `pip install python-memcached` for Memcached) and verify configuration parameters (host, port, credentials) are correct and accessible.
Design your application to initialize Cachy's configuration once at startup. If dynamic configuration is needed, consider if Cachy's global approach aligns with your architecture or if a more isolated caching solution is required.