lrucache

Contents

  • Guides
  • Usage
  • Further Examples
  • API References
  • Caveats
  • Miscellaneous
  • Roadmap
lrucache
  • <no title>
  • View page source

Welcome to the lruheap documentation! This package provides an in-memory LRU (Least Recently Used) cache implementation backed by a min-heap priority queue, along with decorator-based caching for Python functions.

Contents

  • Guides
    • Features
    • Installation
    • Import
    • Quickstart
    • Testing
  • Usage
    • LRUCache class initialization
    • set method
    • get method
    • get_dict method
    • get_duration method
    • get_lru_element method
    • get_capacity method
    • get_cache method
    • get_ttl method
    • clear_all method
    • clear_cache_key method
    • is_empty method
    • ttl property
    • Special methods
    • @lru_cache decorator
    • @lru_cache_time decorator
    • Enable thread_safe parameter
  • Further Examples
    • Using with Django
    • Using with Flask
    • Possible use cases
  • API References
    • lru.lrucache
      • BoundedLRUCache
        • BoundedLRUCache.clear_all()
      • LRUCache
        • LRUCache.clear_all()
        • LRUCache.clear_cache_key()
        • LRUCache.get()
        • LRUCache.get_cache()
        • LRUCache.get_capacity()
        • LRUCache.get_dict()
        • LRUCache.get_duration()
        • LRUCache.get_lru_element()
        • LRUCache.get_ttl()
        • LRUCache.is_empty()
        • LRUCache.set()
        • LRUCache.ttl
    • lru.heap
      • Heap
        • Heap.add()
        • Heap.build_floyd_heap
        • Heap.remove()
        • Heap.remove_key()
        • Heap.update()
    • lru.decorators
      • lru_cache()
      • lru_cache_time()
    • lru.utils
      • BypassThreadSafe
      • generate_hash_key()
  • Caveats
    • Known limitations
    • When is it suitable?
  • Miscellaneous
    • Why object-level caching instead of database filtering?
    • Purpose of this package
  • Roadmap
    • Completed
    • Planned / In progress
      • Contributions
Next

© Copyright 2020–2026, Ryan Febriansyah.

Built with Sphinx using a theme provided by Read the Docs.