Port variant py39
Summary Extensible memoizing collections (3.9)
Package version 5.0.0
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py310
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 21 DEC 2021, 01:59:13 UTC
Port created 21 APR 2020, 22:22:44 UTC
Subpackage Descriptions
single cachetools ======================================================================== :alt: Latest PyPI version :alt: Documentation build status :alt: CI build status :alt: Test coverage :alt: License :alt: Code style: black This module provides various memoizing collections and decorators, including variants of the Python Standard Library's `@lru_cache`_ function decorator. .. code-block:: python from cachetools import cached, LRUCache, TTLCache # speed up calculating Fibonacci numbers with dynamic programming @cached(cache={}) def fib(n): return n if n < 2 else fib(n - 1) + fib(n - 2) # cache least recently used Python Enhancement Proposals @cached(cache=LRUCache(maxsize=32)) def get_pep(num): url = '' % num with urllib.request.urlopen(url) as s: return # cache weather data for no longer than ten minutes @cached(cache=TTLCache(maxsize=1024, ttl=600)) def get_weather(place): return owm.weather_at_place(place).get_weather() For the purpose of this module, a *cache* is a mutable_ mapping_ of a fixed maximum size. When the cache is full, i.e. by adding another item the cache would exceed its maximum size, the cache must choose which item(s) to discard based on a suitable `cache algorithm`_. This module provides multiple cache classes based on different cache algorithms, as well as decorators for easily memoizing function and method calls. Installation ------------------------------------------------------------------------ cachetools is available from PyPI_ and can be installed by running:: pip install cachetools Typing stubs for this package are provided by typeshed_ and can be installed by running:: pip install types-cachetools Project Resources ------------------------------------------------------------------------ - `Documentation`_ - `Issue tracker`_ - `Source code`_ - `Change log`_ License ------------------------------------------------------------------------ Copyright (c) 2014-2021 Thomas Kemmer. Licensed under the `MIT License`_. .. _@lru_cache: .. _mutable: .. _mapping: .. _cache algorithm: .. _PyPI: .. _typeshed: .. _Documentation: .. _Issue tracker: .. _Source code: .. _Change log: .. _MIT License:
Configuration Switches (platform-specific settings discarded)
PY310 OFF Build using Python 3.10 PY39 ON Build using Python 3.9
Package Dependencies by Type
Build (only) python-pip:single:py39
Build and Runtime python39:single:standard
Download groups
main mirror://PYPIWHL/19/99/ace1769546388976b45e93445bb04c6df95e96363f03fbb56f916da5ebde
Distribution File Information
8fecd4203a38af17928be7b90689d8083603073622229ca7077b72d8e5a976e4 9065 cachetools-5.0.0-py3-none-any.whl
Ports that require python-cachetools:py39
python-premailer:py39 Turns CSS blocks into style attributes (3.9)