1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-cachetools
7 SDESC[py310]= Extensible memoizing collections (3.10)
8 SDESC[py39]= Extensible memoizing collections (3.9)
9 HOMEPAGE= https://github.com/tkem/cachetools/
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/99/33/c605db9880c7bf6d58db6bb2953860b1927d28dd033d3bea82323d4e7b25
14 DISTFILE[1]= cachetools-5.1.0-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY39 PY310
20 OPTIONS_STANDARD= none
21 VOPTS[py310]= PY39=OFF PY310=ON
22 VOPTS[py39]= PY39=ON PY310=OFF
24 DISTNAME= cachetools-5.1.0.dist-info
28 [PY39].USES_ON= python:py39,wheel
30 [PY310].USES_ON= python:py310,wheel
32 [FILE:3182:descriptions/desc.single]
34 ========================================================================
36 :alt: Latest PyPI version
38 :alt: Documentation build status
46 :alt: Code style: black
48 This module provides various memoizing collections and decorators,
49 including variants of the Python Standard Library's `@lru_cache`_
52 .. code-block:: python
54 from cachetools import cached, LRUCache, TTLCache
56 # speed up calculating Fibonacci numbers with dynamic programming
59 return n if n < 2 else fib(n - 1) + fib(n - 2)
61 # cache least recently used Python Enhancement Proposals
62 @cached(cache=LRUCache(maxsize=32))
64 url = 'http://www.python.org/dev/peps/pep-%04d/' % num
65 with urllib.request.urlopen(url) as s:
68 # cache weather data for no longer than ten minutes
69 @cached(cache=TTLCache(maxsize=1024, ttl=600))
70 def get_weather(place):
71 return owm.weather_at_place(place).get_weather()
73 For the purpose of this module, a *cache* is a mutable_ mapping_ of a
74 fixed maximum size. When the cache is full, i.e. by adding another
75 item the cache would exceed its maximum size, the cache must choose
76 which item(s) to discard based on a suitable `cache algorithm`_.
78 This module provides multiple cache classes based on different cache
79 algorithms, as well as decorators for easily memoizing function and
83 ------------------------------------------------------------------------
85 cachetools is available from PyPI_ and can be installed by running::
87 pip install cachetools
89 Typing stubs for this package are provided by typeshed_ and can be
90 installed by running::
92 pip install types-cachetools
95 ------------------------------------------------------------------------
103 ------------------------------------------------------------------------
105 - asyncache_: Helpers to use cachetools with async functions
106 - CacheToolsUtils_: Cachetools Utilities
107 - `kids.cache`_: Kids caching library
108 - shelved-cache_: Persistent cache for Python cachetools
111 ------------------------------------------------------------------------
113 Copyright (c) 2014-2022 Thomas Kemmer.
115 Licensed under the `MIT License`_.
118 https://docs.python.org/3/library/functools.html#functools.lru_cache
119 .. _mutable: https://docs.python.org/dev/glossary.html#term-mutable
120 .. _mapping: https://docs.python.org/dev/glossary.html#term-mapping
121 .. _cache algorithm: https://en.wikipedia.org/wiki/Cache_algorithms
123 .. _PyPI: https://pypi.org/project/cachetools/
124 .. _typeshed: https://github.com/python/typeshed/
125 .. _Documentation: https://cachetools.readthedocs.io/
126 .. _Issue tracker: https://github.com/tkem/cachetools/issues/
127 .. _Source code: https://github.com/tkem/cachetools/
129 https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst
130 .. _MIT License: https://raw.github.com/tkem/cachetools/master/LICENSE
132 .. _asyncache: https://pypi.org/project/asyncache/
136 4ebbd38701cdfd3603d1f751d851ed248ab4570929f2d8a7ce69e30c420b141c 9205 cachetools-5.1.0-py3-none-any.whl