high performance in-memory cache
Project description
theine
high performance in-memory cache
Requirements
Python 3.7+
Installation
pip install theine
API
from theine import Cache
from datetime import timedelta
cache = Cache("tlfu", 10000)
# without default, return None on miss
v = cache.get("key")
# with default, return default on miss
sentinel = object()
v = cache.get(key, sentinel)
# set with ttl
cache.set("key", {"foo": "bar"}, timedelta(seconds=100))
# delete from cache
cache.delete("key")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
theine-0.1.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
theine-0.1.1-py3-none-any.whl
(2.6 kB
view hashes)