plone.memoize


Nameplone.memoize JSON
Version 3.0.2 PyPI version JSON
download
home_pagehttps://pypi.org/project/plone.memoize
SummaryDecorators for caching the values of functions and methods
upload_time2023-06-23 17:04:18
maintainer
docs_urlNone
authorPlone Foundation
requires_python>=3.8
licenseBSD
keywords plone memoize decorator cache
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            plone.memoize
=============

plone.memoize provides Python function decorators for caching the
values of functions and methods.

The type of cache storage is freely configurable by the user, as is
the cache key, which is what the function's value depends on.

plone.memoize has support for memcached and is easily extended to use
other caching storages.  It also has specialized decorators for use
with Zope views.  However, plone.memoize can be used without Zope.

Introduction
============

plone.memoize provides Python function decorators for caching the values of functions and methods.

The type of cache storage is freely configurable by the user, as is the cache key, which is what the function's value depends on.

plone.memoize has support for memcached and is easily extended to use other caching storages.
It also has specialized decorators for use with Zope views.
However, plone.memoize can be used without Zope.


Volatile
--------

The 'volatile' module defines a versatile caching decorator that gives you total control of how the cache key is calculated and where it is stored.
This decorator is explained in more in depth with example usage in 'volatile.py'.

'volatile' caches can be stored in different places.
A common use is a zope RAMCache.
There are convenience methods in the 'ram' module to support that.

A quick example of a view that uses 'volatile' caching through the 'ram' module::

    >>> from zope.publisher.browser import BrowserView
    >>> from plone.memoize import ram

    >>> def _render_details_cachekey(method, self, brain):
    ...    return (brain.getPath(), brain.modified)

    >>> class View(BrowserView):
    ...    @ram.cache(_render_details_cachekey)
    ...    def render_details(self, brain):
    ...        obj = brain.getObject()
    ...        view = obj.restrictedTraverse('@@obj-view')
    ...        return view.render()

The results of our hypothetical 'render_details' method are cached *across requests* and independently of the (not) logged in user.
The cache is only refreshed when the brain's path or modification date change, as defined in '_render_details_cachekey'.

This is how you could use the same decorator to cache a function's value for an hour::

    >>> from time import time
    >>> @ram.cache(lambda *args: time() // (60 * 60))
    ... def fun():
    ...     return "Something that takes awfully long"
    >>> fun()
    'Something that takes awfully long'


View and Instance
-----------------

See view.rst and instance.rst for usage of cache decorators that have a fixed cache key and cache storage.
The most common usage pattern of these view and instance caching decorators is::

    >>> from plone.memoize import instance
    >>> class MyClass(object):
    ...   @instance.memoize
    ...   def some_expensive_function(self, arg1, arg2):
    ...       return "Some expensive result"

The first time some_expensive_function() is called, the return value will be saved.
On subsequent calls with the same arguments, the cached version will be returned.
Passing in different arguments will cause the function to be called again.

Note that this only works if the arguments are hashable!

If you are writing a Zope 3 view, you can do::

    >>> from plone.memoize import view
    >>> class MyView(BrowserView):
    ...   @view.memoize
    ...   def some_expensive_function(self, arg1, arg2):
    ...       return "Some expensive result"

This has the same effect, but subsequent lookup of the same view in the same context will be memoized as well.

You can also use @view.memoize_contextless to have the memoization not take the context into account - the same view looked up during the same request (but possibly on another context) with the same parameters will be memoized.

Note that this requires that the request is annotatable using zope.annotation!


Generic
-------

The generic decorator uses the GenericCache module as storage.
By default it'll store into a global cache of its own, with default parameters of 1000 maximal objects and 1 hour maximal lifespan.

You can create your own storage area with its specific parameters using the new_storage method.

Look at the docstring for a few examples.


Keys and Parameters Marshaling
------------------------------

An important issue about caches is how to generate the cache key.
In all the decorators above, you can create your own function.

The marshallers module provide with useful default marshallers.
args_marshaller will compute a key from function name, module and parameters, applying a hash if asked for.
Look into the docstring for usage example.


Changelog
=========

.. You should *NOT* be adding new change log entries to this file.
   You should create a file in the news directory instead.
   For helpful instructions, please see:
   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst

.. towncrier release notes start

3.0.2 (2023-06-23)
------------------

Internal:


- Update configuration files.
  [plone devs] (237ff4c8)


3.0.1 (2023-04-14)
------------------

Internal:


- Update configuration files.
  [plone devs] (93e1ab65)
- Removed more Python 2 compatibility code.
  [maurits] (#55)


3.0.0 (2022-10-28)
------------------

Breaking changes:


- Drop support for Python 3.5 and 3.6.
  Add support for Python 3.9, 3.10, and 3.11. [davisagli] (#27)


2.1.1 (2021-07-28)
------------------

Bug fixes:


- Work in a FIPS enabled environment by using SHA1 instead of MD5 for computing the cache key. [frapell] (#25)


2.1.0 (2020-04-20)
------------------

New features:


- Drop 3.4 support, add 3.7, 3.8, PyPy, PyPy3 support.
  [maurits] (#16)
- Use the zope global request if available as a fallback if the context does not have it [ale-rt] (#17)


Bug fixes:


- Make code black [ale-rt] (#17)
- Improve speed when getting resources from the cache [ale-rt] (#19)
- Remove ``bootstrap-buildout.py``. If you use buildout, use virtualenv and pip install zc.buildout instead.
  Add [isort] and [flake8] config sections into setup.cfg.
  Sort all imports in Python files.
  [thet] (#21)


2.0.1 (2019-04-29)
------------------

Bug fixes:


- Fix broken tests in TravisCI
  (`#12 <https://github.com/plone/plone.memoize/issues/12>`_)
  [andbag] (#12)


2.0.0 (2019-02-08)
------------------

Breaking changes:


- Relicensed under BSD (documented September 2010,
  https://plone.org/foundation/materials/foundation-resolutions/plone-framework-components-relicensing-policy)
  [andbag] (#12)


Bug fixes:


- Clean up package here and there. [gforcada] [mauritsvanrees] (#15)


1.2.3 (2018-09-26)
------------------

Bug fixes:

- Re-enable Travis-CI.
  This package can be used outside Plone so it should be tested outside, too.
  [howitz]


1.2.2 (2018-02-23)
------------------

Bug fixes:

- Drop travis and tox. A solution that works at one point does not necessarily work later.
  plone.memoize is being tested on jenkins.plone.org.
  [gforcada]

- Clean up dependencies.
  [gforcada]


1.2.1 (2017-07-03)
------------------

New:

- Keep docstrings intact in decorators.
  [pgrunewald]

Fixes:

- Update Travis setup (drop Python2.6, tolerate failing pypy3)
  [pgrunewald]


1.2.0 (2016-02-12)
------------------

New:

- Dropped official support for Plone 4 and Python 2.6.  [maurits]

- Python 3 compatibility.  [tomgross]

Fixes:

- Replace deprecated ``zope.testing.doctest`` import with ``doctest`` module
  from stdlib.
  [thet]


1.1.2 (2016-01-08)
------------------

Fixes:

- Restructure docs.
  [thet]

- Minor PEP 8.
  [thet]


1.1.1 (2011-05-12)
------------------

- Add MANIFEST.in.
  [WouterVH]


1.1 (2010-07-18)
----------------

- Update license to GPL version 2 only.
  [hannosch]

- Solve intermittent error during testing of CleanupDict class, as a
  cleanup period of zero seconds would not always result in a cleanup,
  if the tests were run fast.
  [maurits]


1.1b1 (2009-11-13
------------------

- Updated package documentation.
  [hannosch]


1.1a4 (2009-07-23)
------------------

- Use the new `zope.ramcache` package instead of `zope.app.cache`. This
  reduces our dependencies by quite a bit.
  [hannosch]


1.1a3 (2009-05-10)
------------------

- Modernized and cleaned up the code a bit. Also drop BBB support for
  `zope.app.annotation` and made the tests work again.
  [hannosch]


1.1a2 (2009-05-08)
------------------

- Removed all testing dependencies on zope.app packages.
  [hannosch]

- Changed a test to use zope.publisher instead of a Five BrowserView. This
  removes the entire Zope2 dependency.
  [hannosch]

- Correct Zope2 dependency, it's indeed only a test dependency.
  [hannosch]


1.1a1 (2009-04-04)
------------------

- Clarified license statements.
  [hannosch]

- Moved declaration of test dependencies into a test extra.
  [hannosch]

- Avoid deprecation warnings for the md5 and sha modules in Python 2.6.
  [hannosch]

- Specify package dependencies.
  [hannosch]

- Added check for Unicode values in cache keys before calculating md5
  checksums, as the md5 module doesn't seem to like Unicode.
  [hannosch]

- Removed BBB code for zope.app.annotation.
  [hannosch]

- The clearbefore decorator was mistakenly not tested.
  [maurits]


1.0.4 (2008-03-31)
------------------

- Documentation and release notes cleanup.
  [hannosch]


1.0.3 (2007-11-09)
------------------

- Remove features from Plone 3.0 branch.
  [nouri]

- Maintenance branch for Plone 3.0.
  [nouri]

- Get rid of sys.modules hack, which according to this changeset:
  http://dev.plone.org/plone/changeset/15030
  was added because I advised it generally.  With help from Kapil for
  the PloneGetPaid project I figured out a better way.
  [maurits]

- Revise docs and project description.
  [nouri]

- Merge patch from Gael Le Mignot:

    - Do not use hash anymore when making cache keys. This is to
      avoid cache collisions, and to avoid a potential security
      problem where an attacker could manually craft collisions.
      Also, stop recommending the use of hash() in tests.

    - Add support for using Pilot System's GenericCache as a backend
      for 'plone.memoize.volatile.cache'.

    - Add an arguments marshaller that gives you a more convenient
      way to declare that your cache is dependent on arguments.
      See 'plone.memoize.marshallers'.

  [nouri, gael]


1.0.1 (2007-09-10)
------------------

- Simplify forever by reuse of stuff from plone.memoize.volatile.
  [nouri]


1.0 (2007-08-17)
----------------

- Add a forever memo - lives until Zope restart.
  [optilude]

- hash((1, 2)) returns something different on ree's 64-bit Python :)
  [nouri]

- Don't treat None in a special way. Avoid one dict lookup.
  [nouri]

- Extended the xhtml_compress method to use a utility lookup for
  IXHTMLCompressor utilities instead. Now you can turn the slimmer based
  compression on via a simple utility registration. See compress.py.
  [hannosch, fschulze]


1.0rc2 (2007-07-27)
-------------------

- Added simple xhtml_compress method which can be used to plug in
  whitespace removal libraries. Peter Bengtsson's slimmer library is
  configured but not enabled by default.
  [hannosch]


1.0b4 (2007-07-09)
------------------

- Use a md5 hash of the provided key in RAMCacheAdapter, reducing the
  memory footprint and speeding up lookup time.
  [hannosch]

- Reword the volatile section a bit to indicate why the example does not
  use anything from the volatile module.
  [wichert]

- Use an exception `DontCache` instead of the DONT_CACHE marker return
  value. Allow for no `ICacheChooser` to be registered.
  [nouri]

- Add cache decorator for request (which can in fact be used for all
  sorts of annotatable objects).
  [nouri]

- Added decorator for storing cache values on the request as annotations.
  [nouri]

- Always include the function's dotted name in the key.
  [nouri]

- Added a new cache decorator which can memoize a the result of a method
  call on the request and lets you specify which argument on the function
  is the request.
  [hannosch]

- Add MemcacheAdapter as an alternative to RAMCacheAdapter.
  [nouri]

- Generalize `IRAMCacheChooser` to `ICacheChooser`, which doesn't return
  an IRAMCache but a simple dict.
  [nouri]

- Use a more sensible default for the maxAge of the new RAMCache.
  [hannosch]

- Add cache storage for `plone.memoize.volatile` for use with
  `zope.app.cache.ram.RAMCache`.
  [nouri]

- Rolled in changes from memojito to fix recursively memoized
  methods(fix by Rob Miller and Whit Morriss)
  [whit]

- Made plone.memoize backwardly compatible with zope2.9 and remain
  usable w/out zope.annotation. Minor wording changes to some docs.
  [whit]

- Per default, use a volatile dict that cleans up after itself.
  [nouri]

- This 'volatile' module defines a versatile caching decorator that
  gives you total control of how the cache key is calculated and where
  it is stored.
  [nouri]


1.0b3 (2007-05-05)
------------------

- Initial package structure and implementation.
  [hannosch, nouri, optilude, whit, zopeskel]

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/plone.memoize",
    "name": "plone.memoize",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "plone memoize decorator cache",
    "author": "Plone Foundation",
    "author_email": "plone-developers@lists.sourceforge.net",
    "download_url": "https://files.pythonhosted.org/packages/87/6a/62df8d57cb6dc0b9999974713a3c359e9c03b318d5f227fe6935898cf3b4/plone.memoize-3.0.2.tar.gz",
    "platform": null,
    "description": "plone.memoize\n=============\n\nplone.memoize provides Python function decorators for caching the\nvalues of functions and methods.\n\nThe type of cache storage is freely configurable by the user, as is\nthe cache key, which is what the function's value depends on.\n\nplone.memoize has support for memcached and is easily extended to use\nother caching storages.  It also has specialized decorators for use\nwith Zope views.  However, plone.memoize can be used without Zope.\n\nIntroduction\n============\n\nplone.memoize provides Python function decorators for caching the values of functions and methods.\n\nThe type of cache storage is freely configurable by the user, as is the cache key, which is what the function's value depends on.\n\nplone.memoize has support for memcached and is easily extended to use other caching storages.\nIt also has specialized decorators for use with Zope views.\nHowever, plone.memoize can be used without Zope.\n\n\nVolatile\n--------\n\nThe 'volatile' module defines a versatile caching decorator that gives you total control of how the cache key is calculated and where it is stored.\nThis decorator is explained in more in depth with example usage in 'volatile.py'.\n\n'volatile' caches can be stored in different places.\nA common use is a zope RAMCache.\nThere are convenience methods in the 'ram' module to support that.\n\nA quick example of a view that uses 'volatile' caching through the 'ram' module::\n\n    >>> from zope.publisher.browser import BrowserView\n    >>> from plone.memoize import ram\n\n    >>> def _render_details_cachekey(method, self, brain):\n    ...    return (brain.getPath(), brain.modified)\n\n    >>> class View(BrowserView):\n    ...    @ram.cache(_render_details_cachekey)\n    ...    def render_details(self, brain):\n    ...        obj = brain.getObject()\n    ...        view = obj.restrictedTraverse('@@obj-view')\n    ...        return view.render()\n\nThe results of our hypothetical 'render_details' method are cached *across requests* and independently of the (not) logged in user.\nThe cache is only refreshed when the brain's path or modification date change, as defined in '_render_details_cachekey'.\n\nThis is how you could use the same decorator to cache a function's value for an hour::\n\n    >>> from time import time\n    >>> @ram.cache(lambda *args: time() // (60 * 60))\n    ... def fun():\n    ...     return \"Something that takes awfully long\"\n    >>> fun()\n    'Something that takes awfully long'\n\n\nView and Instance\n-----------------\n\nSee view.rst and instance.rst for usage of cache decorators that have a fixed cache key and cache storage.\nThe most common usage pattern of these view and instance caching decorators is::\n\n    >>> from plone.memoize import instance\n    >>> class MyClass(object):\n    ...   @instance.memoize\n    ...   def some_expensive_function(self, arg1, arg2):\n    ...       return \"Some expensive result\"\n\nThe first time some_expensive_function() is called, the return value will be saved.\nOn subsequent calls with the same arguments, the cached version will be returned.\nPassing in different arguments will cause the function to be called again.\n\nNote that this only works if the arguments are hashable!\n\nIf you are writing a Zope 3 view, you can do::\n\n    >>> from plone.memoize import view\n    >>> class MyView(BrowserView):\n    ...   @view.memoize\n    ...   def some_expensive_function(self, arg1, arg2):\n    ...       return \"Some expensive result\"\n\nThis has the same effect, but subsequent lookup of the same view in the same context will be memoized as well.\n\nYou can also use @view.memoize_contextless to have the memoization not take the context into account - the same view looked up during the same request (but possibly on another context) with the same parameters will be memoized.\n\nNote that this requires that the request is annotatable using zope.annotation!\n\n\nGeneric\n-------\n\nThe generic decorator uses the GenericCache module as storage.\nBy default it'll store into a global cache of its own, with default parameters of 1000 maximal objects and 1 hour maximal lifespan.\n\nYou can create your own storage area with its specific parameters using the new_storage method.\n\nLook at the docstring for a few examples.\n\n\nKeys and Parameters Marshaling\n------------------------------\n\nAn important issue about caches is how to generate the cache key.\nIn all the decorators above, you can create your own function.\n\nThe marshallers module provide with useful default marshallers.\nargs_marshaller will compute a key from function name, module and parameters, applying a hash if asked for.\nLook into the docstring for usage example.\n\n\nChangelog\n=========\n\n.. You should *NOT* be adding new change log entries to this file.\n   You should create a file in the news directory instead.\n   For helpful instructions, please see:\n   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst\n\n.. towncrier release notes start\n\n3.0.2 (2023-06-23)\n------------------\n\nInternal:\n\n\n- Update configuration files.\n  [plone devs] (237ff4c8)\n\n\n3.0.1 (2023-04-14)\n------------------\n\nInternal:\n\n\n- Update configuration files.\n  [plone devs] (93e1ab65)\n- Removed more Python 2 compatibility code.\n  [maurits] (#55)\n\n\n3.0.0 (2022-10-28)\n------------------\n\nBreaking changes:\n\n\n- Drop support for Python 3.5 and 3.6.\n  Add support for Python 3.9, 3.10, and 3.11. [davisagli] (#27)\n\n\n2.1.1 (2021-07-28)\n------------------\n\nBug fixes:\n\n\n- Work in a FIPS enabled environment by using SHA1 instead of MD5 for computing the cache key. [frapell] (#25)\n\n\n2.1.0 (2020-04-20)\n------------------\n\nNew features:\n\n\n- Drop 3.4 support, add 3.7, 3.8, PyPy, PyPy3 support.\n  [maurits] (#16)\n- Use the zope global request if available as a fallback if the context does not have it [ale-rt] (#17)\n\n\nBug fixes:\n\n\n- Make code black [ale-rt] (#17)\n- Improve speed when getting resources from the cache [ale-rt] (#19)\n- Remove ``bootstrap-buildout.py``. If you use buildout, use virtualenv and pip install zc.buildout instead.\n  Add [isort] and [flake8] config sections into setup.cfg.\n  Sort all imports in Python files.\n  [thet] (#21)\n\n\n2.0.1 (2019-04-29)\n------------------\n\nBug fixes:\n\n\n- Fix broken tests in TravisCI\n  (`#12 <https://github.com/plone/plone.memoize/issues/12>`_)\n  [andbag] (#12)\n\n\n2.0.0 (2019-02-08)\n------------------\n\nBreaking changes:\n\n\n- Relicensed under BSD (documented September 2010,\n  https://plone.org/foundation/materials/foundation-resolutions/plone-framework-components-relicensing-policy)\n  [andbag] (#12)\n\n\nBug fixes:\n\n\n- Clean up package here and there. [gforcada] [mauritsvanrees] (#15)\n\n\n1.2.3 (2018-09-26)\n------------------\n\nBug fixes:\n\n- Re-enable Travis-CI.\n  This package can be used outside Plone so it should be tested outside, too.\n  [howitz]\n\n\n1.2.2 (2018-02-23)\n------------------\n\nBug fixes:\n\n- Drop travis and tox. A solution that works at one point does not necessarily work later.\n  plone.memoize is being tested on jenkins.plone.org.\n  [gforcada]\n\n- Clean up dependencies.\n  [gforcada]\n\n\n1.2.1 (2017-07-03)\n------------------\n\nNew:\n\n- Keep docstrings intact in decorators.\n  [pgrunewald]\n\nFixes:\n\n- Update Travis setup (drop Python2.6, tolerate failing pypy3)\n  [pgrunewald]\n\n\n1.2.0 (2016-02-12)\n------------------\n\nNew:\n\n- Dropped official support for Plone 4 and Python 2.6.  [maurits]\n\n- Python 3 compatibility.  [tomgross]\n\nFixes:\n\n- Replace deprecated ``zope.testing.doctest`` import with ``doctest`` module\n  from stdlib.\n  [thet]\n\n\n1.1.2 (2016-01-08)\n------------------\n\nFixes:\n\n- Restructure docs.\n  [thet]\n\n- Minor PEP 8.\n  [thet]\n\n\n1.1.1 (2011-05-12)\n------------------\n\n- Add MANIFEST.in.\n  [WouterVH]\n\n\n1.1 (2010-07-18)\n----------------\n\n- Update license to GPL version 2 only.\n  [hannosch]\n\n- Solve intermittent error during testing of CleanupDict class, as a\n  cleanup period of zero seconds would not always result in a cleanup,\n  if the tests were run fast.\n  [maurits]\n\n\n1.1b1 (2009-11-13\n------------------\n\n- Updated package documentation.\n  [hannosch]\n\n\n1.1a4 (2009-07-23)\n------------------\n\n- Use the new `zope.ramcache` package instead of `zope.app.cache`. This\n  reduces our dependencies by quite a bit.\n  [hannosch]\n\n\n1.1a3 (2009-05-10)\n------------------\n\n- Modernized and cleaned up the code a bit. Also drop BBB support for\n  `zope.app.annotation` and made the tests work again.\n  [hannosch]\n\n\n1.1a2 (2009-05-08)\n------------------\n\n- Removed all testing dependencies on zope.app packages.\n  [hannosch]\n\n- Changed a test to use zope.publisher instead of a Five BrowserView. This\n  removes the entire Zope2 dependency.\n  [hannosch]\n\n- Correct Zope2 dependency, it's indeed only a test dependency.\n  [hannosch]\n\n\n1.1a1 (2009-04-04)\n------------------\n\n- Clarified license statements.\n  [hannosch]\n\n- Moved declaration of test dependencies into a test extra.\n  [hannosch]\n\n- Avoid deprecation warnings for the md5 and sha modules in Python 2.6.\n  [hannosch]\n\n- Specify package dependencies.\n  [hannosch]\n\n- Added check for Unicode values in cache keys before calculating md5\n  checksums, as the md5 module doesn't seem to like Unicode.\n  [hannosch]\n\n- Removed BBB code for zope.app.annotation.\n  [hannosch]\n\n- The clearbefore decorator was mistakenly not tested.\n  [maurits]\n\n\n1.0.4 (2008-03-31)\n------------------\n\n- Documentation and release notes cleanup.\n  [hannosch]\n\n\n1.0.3 (2007-11-09)\n------------------\n\n- Remove features from Plone 3.0 branch.\n  [nouri]\n\n- Maintenance branch for Plone 3.0.\n  [nouri]\n\n- Get rid of sys.modules hack, which according to this changeset:\n  http://dev.plone.org/plone/changeset/15030\n  was added because I advised it generally.  With help from Kapil for\n  the PloneGetPaid project I figured out a better way.\n  [maurits]\n\n- Revise docs and project description.\n  [nouri]\n\n- Merge patch from Gael Le Mignot:\n\n    - Do not use hash anymore when making cache keys. This is to\n      avoid cache collisions, and to avoid a potential security\n      problem where an attacker could manually craft collisions.\n      Also, stop recommending the use of hash() in tests.\n\n    - Add support for using Pilot System's GenericCache as a backend\n      for 'plone.memoize.volatile.cache'.\n\n    - Add an arguments marshaller that gives you a more convenient\n      way to declare that your cache is dependent on arguments.\n      See 'plone.memoize.marshallers'.\n\n  [nouri, gael]\n\n\n1.0.1 (2007-09-10)\n------------------\n\n- Simplify forever by reuse of stuff from plone.memoize.volatile.\n  [nouri]\n\n\n1.0 (2007-08-17)\n----------------\n\n- Add a forever memo - lives until Zope restart.\n  [optilude]\n\n- hash((1, 2)) returns something different on ree's 64-bit Python :)\n  [nouri]\n\n- Don't treat None in a special way. Avoid one dict lookup.\n  [nouri]\n\n- Extended the xhtml_compress method to use a utility lookup for\n  IXHTMLCompressor utilities instead. Now you can turn the slimmer based\n  compression on via a simple utility registration. See compress.py.\n  [hannosch, fschulze]\n\n\n1.0rc2 (2007-07-27)\n-------------------\n\n- Added simple xhtml_compress method which can be used to plug in\n  whitespace removal libraries. Peter Bengtsson's slimmer library is\n  configured but not enabled by default.\n  [hannosch]\n\n\n1.0b4 (2007-07-09)\n------------------\n\n- Use a md5 hash of the provided key in RAMCacheAdapter, reducing the\n  memory footprint and speeding up lookup time.\n  [hannosch]\n\n- Reword the volatile section a bit to indicate why the example does not\n  use anything from the volatile module.\n  [wichert]\n\n- Use an exception `DontCache` instead of the DONT_CACHE marker return\n  value. Allow for no `ICacheChooser` to be registered.\n  [nouri]\n\n- Add cache decorator for request (which can in fact be used for all\n  sorts of annotatable objects).\n  [nouri]\n\n- Added decorator for storing cache values on the request as annotations.\n  [nouri]\n\n- Always include the function's dotted name in the key.\n  [nouri]\n\n- Added a new cache decorator which can memoize a the result of a method\n  call on the request and lets you specify which argument on the function\n  is the request.\n  [hannosch]\n\n- Add MemcacheAdapter as an alternative to RAMCacheAdapter.\n  [nouri]\n\n- Generalize `IRAMCacheChooser` to `ICacheChooser`, which doesn't return\n  an IRAMCache but a simple dict.\n  [nouri]\n\n- Use a more sensible default for the maxAge of the new RAMCache.\n  [hannosch]\n\n- Add cache storage for `plone.memoize.volatile` for use with\n  `zope.app.cache.ram.RAMCache`.\n  [nouri]\n\n- Rolled in changes from memojito to fix recursively memoized\n  methods(fix by Rob Miller and Whit Morriss)\n  [whit]\n\n- Made plone.memoize backwardly compatible with zope2.9 and remain\n  usable w/out zope.annotation. Minor wording changes to some docs.\n  [whit]\n\n- Per default, use a volatile dict that cleans up after itself.\n  [nouri]\n\n- This 'volatile' module defines a versatile caching decorator that\n  gives you total control of how the cache key is calculated and where\n  it is stored.\n  [nouri]\n\n\n1.0b3 (2007-05-05)\n------------------\n\n- Initial package structure and implementation.\n  [hannosch, nouri, optilude, whit, zopeskel]\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Decorators for caching the values of functions and methods",
    "version": "3.0.2",
    "project_urls": {
        "Homepage": "https://pypi.org/project/plone.memoize"
    },
    "split_keywords": [
        "plone",
        "memoize",
        "decorator",
        "cache"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99c9e26278cdb198fd172d22d2f4c7643dcf58e515ed6a8396eece5fdcde930a",
                "md5": "f2a1aa0902ff0ca4b906049ee41d431d",
                "sha256": "e136ee35c070dba71aa0d73279dffe2c7f312eb70c70364bc8e746a2438f6460"
            },
            "downloads": -1,
            "filename": "plone.memoize-3.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f2a1aa0902ff0ca4b906049ee41d431d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 25580,
            "upload_time": "2023-06-23T17:04:03",
            "upload_time_iso_8601": "2023-06-23T17:04:03.570403Z",
            "url": "https://files.pythonhosted.org/packages/99/c9/e26278cdb198fd172d22d2f4c7643dcf58e515ed6a8396eece5fdcde930a/plone.memoize-3.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "876a62df8d57cb6dc0b9999974713a3c359e9c03b318d5f227fe6935898cf3b4",
                "md5": "6e0023abc9da6d2aeaaa0a1fe48bdaff",
                "sha256": "2f96508cf5f9a2966c0d1b20bab4ef4221e2005c0ab82b4654bf55e941cd2008"
            },
            "downloads": -1,
            "filename": "plone.memoize-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6e0023abc9da6d2aeaaa0a1fe48bdaff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26075,
            "upload_time": "2023-06-23T17:04:18",
            "upload_time_iso_8601": "2023-06-23T17:04:18.476510Z",
            "url": "https://files.pythonhosted.org/packages/87/6a/62df8d57cb6dc0b9999974713a3c359e9c03b318d5f227fe6935898cf3b4/plone.memoize-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-23 17:04:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "plone.memoize"
}
        
Elapsed time: 0.11072s