{ "info": { "author": "Enrico Bacis", "author_email": "enrico.bacis@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Description\n-----------\n\n*memoize* and *keyed-memoize* decorators.\n\n- ``memo``: The classical *memoize* decorator. It keeps a cache\n ``args -> result`` so you don't continue to perform the same computations.\n\n- ``keymemo(key)``: This decorator factory act as ``memo`` but it permits to\n specify a ``key`` function that takes the ``args`` of the decorated function\n and computes a ``key`` value to use as key in the cache dictionary. This way\n you can for example use a single value of a dictionary as key of the cache,\n or apply a function before passing something to the cache.\n\n- ``instancememo``: The classical *memoize* decorator that can be applied to\n class functions. It keeps a cache ``args -> result`` so you don't continue\n to perform the same computations. The cache is kept in the class namespace.\n\n- ``instancekeymemo(key)``: This decorator factory works like a combination of\n ``instancememo`` and ``keymemo``, so it allows to specify a function that\n generate the cache key based on the function arguments and can be applied\n to class functions.\n\n\nUsage\n-----\n\n.. code:: python\n\n from memo import memo\n\n @memo\n def fibonacci(n):\n if n <= 2:\n return 1\n return fibonacci(n-1) + fibonacci(n-2)\n\n.. code:: python\n\n from memo import keymemo\n\n @keymemo(lambda tup: tup[0])\n def function(tup):\n # build a cache based on the first value of a tuple\n ...\n\nInstallation\n------------\n\nThe package has been uploaded to `PyPI`_, so you can install it with pip:\n\n pip install python-memo\n\n\n.. _PyPI: https://pypi.python.org/pypi/python-memo\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/enricobacis/python-memo", "keywords": "memo memoize dynamic programming cache decorator instance", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-memo", "package_url": "https://pypi.org/project/python-memo/", "platform": "", "project_url": "https://pypi.org/project/python-memo/", "project_urls": { "Homepage": "http://github.com/enricobacis/python-memo" }, "release_url": "https://pypi.org/project/python-memo/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Decorators to memoize function results (also for classes)", "version": "0.1.0" }, "last_serial": 2641613, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0cc30dc9030824cac503081ba8498d5a", "sha256": "b299488ba0263b04bf2cefde2879b3b26bbd37db53d997c9e656056844dcdba6" }, "downloads": -1, "filename": "python-memo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0cc30dc9030824cac503081ba8498d5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2242, "upload_time": "2017-02-14T17:25:32", "url": "https://files.pythonhosted.org/packages/50/b2/9c7ab2c1b7832b10d6345088d363ae378aecd5fd1b6beb9a8bf794ec501d/python-memo-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0cc30dc9030824cac503081ba8498d5a", "sha256": "b299488ba0263b04bf2cefde2879b3b26bbd37db53d997c9e656056844dcdba6" }, "downloads": -1, "filename": "python-memo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0cc30dc9030824cac503081ba8498d5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2242, "upload_time": "2017-02-14T17:25:32", "url": "https://files.pythonhosted.org/packages/50/b2/9c7ab2c1b7832b10d6345088d363ae378aecd5fd1b6beb9a8bf794ec501d/python-memo-0.1.0.tar.gz" } ] }