Memcache Client for Python#
Experimental memcached client library for python. This project is in WIP status, please don’t use it in production environment.
Key features:
Based on memcached’s new meta commands;
Asyncio support;
Type hints.
Installation#
$ pip install memcache
API document#
- class memcache.AsyncMemcache(addr: ~typing.Optional[~typing.Union[~typing.Tuple[str, int], ~typing.List[~typing.Tuple[str, int]]]] = None, *, pool_size: ~typing.Optional[int] = 23, pool_timeout: ~typing.Optional[int] = 1, load_func: ~typing.Callable[[~typing.Union[str, bytes], bytes, int], ~typing.Any] = <function load>, dump_func: ~typing.Callable[[~typing.Union[str, bytes], ~typing.Any], ~typing.Tuple[bytes, int]] = <function dump>, username: ~typing.Optional[str] = None, password: ~typing.Optional[str] = None)#
- async delete(key: Union[bytes, str]) None #
- async execute_meta_command(command: MetaCommand) MetaResult #
- async flush_all() None #
- async get(key: Union[bytes, str]) Optional[Any] #
- async set(key: Union[bytes, str], value: Any, *, expire: Optional[int] = None) None #
- class memcache.Memcache(addr: ~typing.Optional[~typing.Union[~typing.Tuple[str, int], ~typing.List[~typing.Tuple[str, int]]]] = None, *, pool_size: ~typing.Optional[int] = 23, pool_timeout: ~typing.Optional[int] = 1, load_func: ~typing.Callable[[~typing.Union[str, bytes], bytes, int], ~typing.Any] = <function load>, dump_func: ~typing.Callable[[~typing.Union[str, bytes], ~typing.Any], ~typing.Tuple[bytes, int]] = <function dump>, username: ~typing.Optional[str] = None, password: ~typing.Optional[str] = None)#
- delete(key: Union[bytes, str]) None #
- execute_meta_command(command: MetaCommand) MetaResult #
- flush_all() None #
- get(key: Union[bytes, str]) Optional[Any] #
- set(key: Union[bytes, str], value: Any, *, expire: Optional[int] = None) None #
- exception memcache.MemcacheError#
License#
Memcache is distributed by a MIT license.