blob: afe337574a27269e7fdb60627e901d8424ba58a3 [file] [log] [blame]
Thomas Kemmerfa0e6062014-03-22 11:09:33 +01001cachetools
2========================================================================
3
Thomas Kemmera34b1fa2014-03-22 12:57:39 +01004This module provides various memoizing collections and function
5decorators, including a variant of the Python 3 functools.lru_cache_
6decorator.
7
8.. note::
9
10 This module is in early pre-alpha, and not fit for *any* purpose
11 (yet).
Thomas Kemmerfa0e6062014-03-22 11:09:33 +010012
13.. code-block:: pycon
14
Thomas Kemmera34b1fa2014-03-22 12:57:39 +010015 >>> from cachetools import LRUCache
16 >>> cache = LRUCache(maxsize=16)
17 >>> cache['test'] = 1
18 >>> cache.info()
19 CacheInfo(hits=0, misses=0, maxsize=16, currsize=1)
20 >>> cache['test']
21 1
22 >>> cache.info()
23 CacheInfo(hits=1, misses=0, maxsize=16, currsize=1)
Thomas Kemmerfa0e6062014-03-22 11:09:33 +010024
25
26Installation
27------------------------------------------------------------------------
28
29Install cachetools using pip::
30
31 pip install cachetools
32
33
34Project Resources
35------------------------------------------------------------------------
36
Thomas Kemmera34b1fa2014-03-22 12:57:39 +010037- `Documentation`_
38- `Issue Tracker`_
39- `Source Code`_
40- `Change Log`_
Thomas Kemmerfa0e6062014-03-22 11:09:33 +010041
42.. image:: https://pypip.in/v/cachetools/badge.png
43 :target: https://pypi.python.org/pypi/cachetools/
44 :alt: Latest PyPI version
45
46.. image:: https://pypip.in/d/cachetools/badge.png
47 :target: https://pypi.python.org/pypi/cachetools/
48 :alt: Number of PyPI downloads
Thomas Kemmera34b1fa2014-03-22 12:57:39 +010049
50
51License
52------------------------------------------------------------------------
53
54cachetools is Copyright 2014 Thomas Kemmer.
55
56Licensed under the `MIT License`_.
57
58
59.. _functools.lru_cache: http://docs.python.org/3.4/library/functools.html#functools.lru_cache
60
61.. _Documentation: http://pythonhosted.org/cachetools/
62.. _Source Code: https://github.com/tkem/cachetools/
63.. _Issue Tracker: https://github.com/tkem/cachetools/issues/
64.. _Change Log: https://raw.github.com/tkem/cachetools/master/Changes
65.. _MIT License: http://opensource.org/licenses/MIT