Thomas Kemmer | fa0e606 | 2014-03-22 11:09:33 +0100 | [diff] [blame] | 1 | cachetools |
| 2 | ======================================================================== |
| 3 | |
Thomas Kemmer | a34b1fa | 2014-03-22 12:57:39 +0100 | [diff] [blame^] | 4 | This module provides various memoizing collections and function |
| 5 | decorators, including a variant of the Python 3 functools.lru_cache_ |
| 6 | decorator. |
| 7 | |
| 8 | .. note:: |
| 9 | |
| 10 | This module is in early pre-alpha, and not fit for *any* purpose |
| 11 | (yet). |
Thomas Kemmer | fa0e606 | 2014-03-22 11:09:33 +0100 | [diff] [blame] | 12 | |
| 13 | .. code-block:: pycon |
| 14 | |
Thomas Kemmer | a34b1fa | 2014-03-22 12:57:39 +0100 | [diff] [blame^] | 15 | >>> 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 Kemmer | fa0e606 | 2014-03-22 11:09:33 +0100 | [diff] [blame] | 24 | |
| 25 | |
| 26 | Installation |
| 27 | ------------------------------------------------------------------------ |
| 28 | |
| 29 | Install cachetools using pip:: |
| 30 | |
| 31 | pip install cachetools |
| 32 | |
| 33 | |
| 34 | Project Resources |
| 35 | ------------------------------------------------------------------------ |
| 36 | |
Thomas Kemmer | a34b1fa | 2014-03-22 12:57:39 +0100 | [diff] [blame^] | 37 | - `Documentation`_ |
| 38 | - `Issue Tracker`_ |
| 39 | - `Source Code`_ |
| 40 | - `Change Log`_ |
Thomas Kemmer | fa0e606 | 2014-03-22 11:09:33 +0100 | [diff] [blame] | 41 | |
| 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 Kemmer | a34b1fa | 2014-03-22 12:57:39 +0100 | [diff] [blame^] | 49 | |
| 50 | |
| 51 | License |
| 52 | ------------------------------------------------------------------------ |
| 53 | |
| 54 | cachetools is Copyright 2014 Thomas Kemmer. |
| 55 | |
| 56 | Licensed 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 |