Quick and small memcached client for Python
86
A small cache wrapper that guarantees text and bytes keys behave as aliases of the same entry when talking to a memcached backend.
{"source": "text"} using key "café-token" and reading with b"caf\xc3\xa9-token" returns the stored value with no duplicate entry created @test"alpha" and b"brav\xc3\xb3", calling get_many([b"alpha", "bravó"]) returns both cached values keyed as b"alpha" and "bravó" without duplicating entries @testb"café-token" removes the value so that a follow-up read with "café-token" returns the supplied default @test@generates
class CacheBridge:
def __init__(self, servers: list[str] | tuple[str, ...], *, default_ttl: int = 0): ...
def set_value(self, key: str | bytes, value: object, ttl: int | None = None) -> bool: ...
def get_value(self, key: str | bytes, default: object | None = None) -> object | None: ...
def get_many(self, keys: list[str | bytes]) -> dict[str | bytes, object]: ...
def delete_value(self, key: str | bytes) -> bool: ...Memcached client with UTF-8 normalization between text and byte keys.
Install with Tessl CLI
npx tessl i tessl/pypi-pylibmcevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10