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