{"id":27185165,"url":"https://github.com/saviornt/cachemanager","last_synced_at":"2025-04-09T17:11:32.371Z","repository":{"id":283186512,"uuid":"950957836","full_name":"saviornt/CacheManager","owner":"saviornt","description":"A flexible caching system that supports both local file-based caching (using shelve) and Redis-based caching.","archived":false,"fork":false,"pushed_at":"2025-03-22T05:43:00.000Z","size":5603,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T17:11:22.788Z","etag":null,"topics":["cache","cache-control","cache-management","cache-storage","caching","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saviornt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-19T00:16:31.000Z","updated_at":"2025-03-22T05:43:03.000Z","dependencies_parsed_at":"2025-03-19T01:44:48.704Z","dependency_job_id":null,"html_url":"https://github.com/saviornt/CacheManager","commit_stats":null,"previous_names":["saviornt/cachemanager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saviornt%2FCacheManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saviornt%2FCacheManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saviornt%2FCacheManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saviornt%2FCacheManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saviornt","download_url":"https://codeload.github.com/saviornt/CacheManager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074964,"owners_count":21043490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cache-control","cache-management","cache-storage","caching","python"],"created_at":"2025-04-09T17:11:31.722Z","updated_at":"2025-04-09T17:11:32.363Z","avatar_url":"https://github.com/saviornt.png","language":"Python","readme":"# CacheManager\n\nA flexible and extensible caching solution for Python applications supporting multiple cache layers, eviction policies, and advanced features.\n\n## Features\n\n- **Multilayer Caching**: Combine memory, Redis, and disk caching for optimal performance\n- **Configurable Eviction Policies**: LRU, LFU, and FIFO implementations\n- **Advanced Caching Strategies**:\n  - Compression for efficient storage\n  - Namespacing for logical separation\n  - Telemetry for monitoring cache performance\n  - Security features for data protection\n  - Resilience mechanisms\n- **Decorator-based Caching**: Easily cache function results\n- **Bulk Operations**: Efficient handling of multiple cache items\n- **Extensive Configuration Options**: Fine-tune cache behavior for your needs\n\n## Installation\n\n```bash\npip install git+https://github.com/saviornt/cachemanager\n```\n\n## Quick Start\n\n```python\nfrom src.cache_manager import CacheManager\nfrom src.cache_config import CacheConfig\n\n# Create a cache configuration\nconfig = CacheConfig(\n    cache_ttl=300,  # 5 minutes TTL\n    eviction_policy='LRU',  # Use Least Recently Used eviction\n    memory_cache_enabled=True,  # Enable in-memory caching\n    disk_cache_enabled=True,  # Enable disk caching\n    cache_dir='./cache'  # Location for disk cache\n)\n\n# Initialize cache manager\ncache = CacheManager(config)\n\n# Set a value in the cache\ncache.set('key1', 'value1')\n\n# Get a value from the cache\nvalue = cache.get('key1')\n\n# Use the caching decorator\n@cache.cached()\ndef expensive_operation(param):\n    # Expensive computation here\n    return result\n\n# Call the function - result will be cached\nresult1 = expensive_operation('param1')\nresult2 = expensive_operation('param1')  # Returns cached result\n```\n\n## Advanced Usage\n\n### Hybrid Caching\n\n```python\nfrom src.cache_config import CacheConfig, CacheLayerConfig, CacheLayerType\n\n# Configure multiple cache layers\nconfig = CacheConfig(\n    use_layered_cache=True,\n    cache_layers=[\n        CacheLayerConfig(type=CacheLayerType.MEMORY, ttl=60),  # 1 minute in memory\n        CacheLayerConfig(type=CacheLayerType.REDIS, ttl=300),  # 5 minutes in Redis\n        CacheLayerConfig(type=CacheLayerType.DISK, ttl=3600)   # 1 hour on disk\n    ]\n)\n\n# Initialize cache manager with layered caching\ncache = CacheManager(config)\n```\n\n### Data Compression\n\n```python\n# Enable compression for large objects\nconfig = CacheConfig(\n    enable_compression=True,\n    compression_min_size=1024,  # Compress objects larger than 1KB\n    compression_level=6         # Compression level (1-9)\n)\n\ncache = CacheManager(config)\n```\n\n## Contributing\n\nContributions are welcome! Please see [Contributing Guide](docs/build/html/contributing.html) for details.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaviornt%2Fcachemanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaviornt%2Fcachemanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaviornt%2Fcachemanager/lists"}