LRUCache
crawlee._utils.lru_cache.LRUCache
Index
Constructors
Methods
Constructors
__init__
Create a LRUCache with a specific max_length.
Parameters
max_length: int
Returns None
Methods
__delitem__
Remove an item from the cache.
Parameters
key: str
Returns None
__getitem__
Get an item from the cache. Move it to the end if present.
Parameters
key: str
Returns T
__iter__
Iterate over the keys of the cache in order of insertion.
Returns Iterator[str]
__len__
Get the number of items in the cache.
Returns int
__setitem__
Add an item to the cache. Remove least used item if max_length exceeded.
Parameters
key: str
value: T
Returns None
items
Iterate over the pairs of (key, value) in the cache in order of insertion.
Returns ItemsView[str, T]
values
Iterate over the values in the cache in order of insertion.
Returns ValuesView[T]
Attempt to reimplement LRUCache from
@apify/datastructures
usingOrderedDict
.