OLD | NEW |
(Empty) | |
| 1 Metadata-Version: 2.0 |
| 2 Name: cachetools |
| 3 Version: 1.1.6 |
| 4 Summary: Extensible memoizing collections and decorators |
| 5 Home-page: https://github.com/tkem/cachetools |
| 6 Author: Thomas Kemmer |
| 7 Author-email: tkemmer@computer.org |
| 8 License: MIT |
| 9 Keywords: c,a,c,h,e, ,c,a,c,h,i,n,g, ,m,e,m,o,i,z,e, ,m,e,m,o,i,z,i,n,g, ,m,e,m,
o,i,z,a,t,i,o,n, ,L,R,U, ,L,F,U, ,T,T,L |
| 10 Platform: UNKNOWN |
| 11 Classifier: Development Status :: 5 - Production/Stable |
| 12 Classifier: Environment :: Other Environment |
| 13 Classifier: Intended Audience :: Developers |
| 14 Classifier: License :: OSI Approved :: MIT License |
| 15 Classifier: Operating System :: OS Independent |
| 16 Classifier: Programming Language :: Python |
| 17 Classifier: Programming Language :: Python :: 2 |
| 18 Classifier: Programming Language :: Python :: 2.7 |
| 19 Classifier: Programming Language :: Python :: 3 |
| 20 Classifier: Programming Language :: Python :: 3.2 |
| 21 Classifier: Programming Language :: Python :: 3.3 |
| 22 Classifier: Programming Language :: Python :: 3.4 |
| 23 Classifier: Programming Language :: Python :: 3.5 |
| 24 Classifier: Topic :: Software Development :: Libraries :: Python Modules |
| 25 |
| 26 cachetools |
| 27 ======================================================================== |
| 28 |
| 29 This module provides various memoizing collections and decorators, |
| 30 including variants of the Python 3 Standard Library `@lru_cache`_ |
| 31 function decorator. |
| 32 |
| 33 .. code-block:: pycon |
| 34 |
| 35 >>> from cachetools import LRUCache |
| 36 >>> cache = LRUCache(maxsize=2) |
| 37 >>> cache.update([('first', 1), ('second', 2)]) |
| 38 >>> cache |
| 39 LRUCache([('second', 2), ('first', 1)], maxsize=2, currsize=2) |
| 40 >>> cache['third'] = 3 |
| 41 >>> cache |
| 42 LRUCache([('second', 2), ('third', 3)], maxsize=2, currsize=2) |
| 43 >>> cache['second'] |
| 44 2 |
| 45 >>> cache['fourth'] = 4 |
| 46 >>> cache |
| 47 LRUCache([('second', 2), ('fourth', 4)], maxsize=2, currsize=2) |
| 48 |
| 49 For the purpose of this module, a *cache* is a mutable_ mapping_ of a |
| 50 fixed maximum size. When the cache is full, i.e. by adding another |
| 51 item the cache would exceed its maximum size, the cache must choose |
| 52 which item(s) to discard based on a suitable `cache algorithm`_. In |
| 53 general, a cache's size is the total size of its items, and an item's |
| 54 size is a property or function of its value, e.g. the result of |
| 55 ``sys.getsizeof(value)``. For the trivial but common case that each |
| 56 item counts as ``1``, a cache's size is equal to the number of its |
| 57 items, or ``len(cache)``. |
| 58 |
| 59 Multiple cache classes based on different caching algorithms are |
| 60 implemented, and decorators for easily memoizing function and method |
| 61 calls are provided, too. |
| 62 |
| 63 |
| 64 Installation |
| 65 ------------------------------------------------------------------------ |
| 66 |
| 67 Install cachetools using pip:: |
| 68 |
| 69 pip install cachetools |
| 70 |
| 71 |
| 72 Project Resources |
| 73 ------------------------------------------------------------------------ |
| 74 |
| 75 .. image:: http://img.shields.io/pypi/v/cachetools.svg?style=flat |
| 76 :target: https://pypi.python.org/pypi/cachetools/ |
| 77 :alt: Latest PyPI version |
| 78 |
| 79 .. image:: http://img.shields.io/pypi/dm/cachetools.svg?style=flat |
| 80 :target: https://pypi.python.org/pypi/cachetools/ |
| 81 :alt: Number of PyPI downloads |
| 82 |
| 83 .. image:: http://img.shields.io/travis/tkem/cachetools/master.svg?style=flat |
| 84 :target: https://travis-ci.org/tkem/cachetools/ |
| 85 :alt: Travis CI build status |
| 86 |
| 87 .. image:: http://img.shields.io/coveralls/tkem/cachetools/master.svg?style=flat |
| 88 :target: https://coveralls.io/r/tkem/cachetools |
| 89 :alt: Test coverage |
| 90 |
| 91 - `Documentation`_ |
| 92 - `Issue Tracker`_ |
| 93 - `Source Code`_ |
| 94 - `Change Log`_ |
| 95 |
| 96 |
| 97 License |
| 98 ------------------------------------------------------------------------ |
| 99 |
| 100 Copyright (c) 2014-2016 Thomas Kemmer. |
| 101 |
| 102 Licensed under the `MIT License`_. |
| 103 |
| 104 |
| 105 .. _@lru_cache: http://docs.python.org/3/library/functools.html#functools.lru_ca
che |
| 106 .. _mutable: http://docs.python.org/dev/glossary.html#term-mutable |
| 107 .. _mapping: http://docs.python.org/dev/glossary.html#term-mapping |
| 108 .. _cache algorithm: http://en.wikipedia.org/wiki/Cache_algorithms |
| 109 |
| 110 .. _Documentation: http://pythonhosted.org/cachetools/ |
| 111 .. _Issue Tracker: https://github.com/tkem/cachetools/issues/ |
| 112 .. _Source Code: https://github.com/tkem/cachetools/ |
| 113 .. _Change Log: https://github.com/tkem/cachetools/blob/master/CHANGES.rst |
| 114 .. _MIT License: http://raw.github.com/tkem/cachetools/master/LICENSE |
| 115 |
| 116 |
OLD | NEW |