{ "info": { "author": "Dmitry Orlov ", "author_email": "me@mosquito.su", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Programming Language :: Python" ], "description": "Object Cacher\n=============\n\nSimple cacher for your objects. Store copy of objects in memory (or pickle in file) and returns copy of that objects. Function arguments it is a cache key.\n\n >>> from object_cacher import ObjectCacher\n >>> @ObjectCacher(timeout=5)\n ... def test(*args):\n ... print ('Real call')\n ... return args\n ...\n >>> test(1,2,3)\n Real call\n (1, 2, 3)\n\n >>> test(1,2,3)\n (1, 2, 3)\n\n >>> test(1,2,3,4)\n Real call\n (1, 2, 3, 4)\n\n >>> test(1,2,3,4)\n ... (1, 2, 3, 4)\n\nMakes cache for results of hard functions or methods.\nFor example you have remote RESTful api with a lot of dictionaries. You may cache it:\n\n >>> from urllib import urlopen\n >>> from object_cacher import ObjectCacher\n >>> @ObjectCacher(timeout=60)\n ... def get_api():\n ... print \"This real call\"\n ... return urlopen('https://api.github.com/').read()\n ...\n >>> get_api()\n This real call\n '{\"current_user_url\":\"https://api.github.com/user\", ...'\n >>> get_api()\n '{\"current_user_url\":\"https://api.github.com/user\", ...'\n\nAs result you made http request only once.\n\nFor methods you may use it like this:\n\n >>> from urllib import urlopen\n >>> from object_cacher import ObjectCacher\n >>> class API(object):\n ... @ObjectCacher(timeout=60, ignore_self=True)\n ... def get_methods(self):\n ... print \"Real call\"\n ... return urlopen('https://api.github.com/').read()\n ...\n >>> a = API()\n >>> a.get_methods()\n Real call\n '{\"current_user_url\":\"https://api.github.com/user\", ...'\n >>> b = API()\n >>> b.get_methods()\n '{\"current_user_url\":\"https://api.github.com/user\", ...'\n\nIf ignore_self parameter is set, cache will be shared by all instances. Otherwise cache for instances will be split.\n\nAlso you may use persistent cache.\nThe \"ObjectPersistentCacher\" class-decorator makes file-based pickle-serialized cache storage.\nWhen you want to keep cache after rerun you must determine cache id:\n\n >>> from urllib import urlopen\n >>> from object_cacher import ObjectCacher\n >>> class API(object):\n ... @ObjectPersistentCacher(timeout=60, ignore_self=True, oid='com.github.api.listofmethods')\n ... def get_methods(self):\n ... print \"Real call\"\n ... return urlopen('https://api.github.com/').read()\n ...\n >>> a = API()\n >>> a.get_methods()\n Real call\n '{\"current_user_url\":\"https://api.github.com/user\", ...'\n >>> b = API()\n >>> b.get_methods()\n '{\"current_user_url\":\"https://api.github.com/user\", ...'\n\nThat is keep cache after rerun.\n\nYou may change cache dir for ObjectPersistentCacher via changing 'CACHE_DIR' class-property.\n\n >>> ObjectPersistentCacher.CACHE_DIR = '/var/tmp/my_cache'\n\n\nInstallation\n++++++++++++\n\nYou may install from pypi\n\n pip install object_cacher\n\nor manual\n\n python setup.py install", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mosquito/object_cacher", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "object_cacher", "package_url": "https://pypi.org/project/object_cacher/", "platform": "all", "project_url": "https://pypi.org/project/object_cacher/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/mosquito/object_cacher" }, "release_url": "https://pypi.org/project/object_cacher/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "Simple objects/methods results cacher with optional persistent cacheing. Supports Memory Files or Redis as storage", "version": "0.3.1" }, "last_serial": 1498033, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "13a11f69267e063772b3764e3b4296a0", "sha256": "590d0fa2e14e5dac0735d4ffe849608c054cbca6673afb529df880cde5d68673" }, "downloads": -1, "filename": "object_cacher-0.1.0.tar.gz", "has_sig": false, "md5_digest": "13a11f69267e063772b3764e3b4296a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3832, "upload_time": "2014-06-22T11:28:15", "url": "https://files.pythonhosted.org/packages/d5/37/c068f2287ca3eef74c91d64bb810dcc405d0cd71493f52c82b1bc9164e8c/object_cacher-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8e32171511298203d9d5a9d67e401a74", "sha256": "6a40a3ae656336f749b6eee3bcc025042e0f018e5d1fe578dede5bfff94f0b6e" }, "downloads": -1, "filename": "object_cacher-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8e32171511298203d9d5a9d67e401a74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3620, "upload_time": "2014-06-22T11:30:15", "url": "https://files.pythonhosted.org/packages/14/78/c095b0737a9bdc53ef509053b33d68e67e5372a9627126ebb15a0b451e13/object_cacher-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3d74db66737df94b1ea37c6eed287425", "sha256": "a45a96c5aa966e8fac7be344d0de8ccb9ecfc65841c227026e4ff78303598d2c" }, "downloads": -1, "filename": "object_cacher-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3d74db66737df94b1ea37c6eed287425", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3153, "upload_time": "2014-06-22T11:32:00", "url": "https://files.pythonhosted.org/packages/ca/e8/cca28ce01593ec2c8809bda93aaed5694a6683b73987c3974305ca0f3b74/object_cacher-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6b2835e460513f8df3656a441fd445f2", "sha256": "d2b3cd29264eae8952a187ccb24cadea629c79e6db917e59f205ba5c6a2bb65d" }, "downloads": -1, "filename": "object_cacher-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6b2835e460513f8df3656a441fd445f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3249, "upload_time": "2014-06-22T12:05:32", "url": "https://files.pythonhosted.org/packages/6b/a0/87fd5953a96353872cf746741be535e3b9d87c210f1c4e567ed1719c42d6/object_cacher-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "7d21fb55e2955b728c332bf855f9ffec", "sha256": "12ce235ee9c9660c4bd4e921640ac9f2d7eb7dc7a5af7d89ca8bbd1abcc2dcd2" }, "downloads": -1, "filename": "object_cacher-0.1.4.tar.gz", "has_sig": false, "md5_digest": "7d21fb55e2955b728c332bf855f9ffec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3266, "upload_time": "2014-06-22T12:08:15", "url": "https://files.pythonhosted.org/packages/ed/50/b7c553c743a48085c61301bd0b9a8c2353c4c31b7ebec11736dad2f6225e/object_cacher-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "027401e8de40d4c4567f082960682b50", "sha256": "6862c5b5240e56135e53d8836eceb4f5efca191ad39301c63671eefb3c2a4bd0" }, "downloads": -1, "filename": "object_cacher-0.1.5.tar.gz", "has_sig": false, "md5_digest": "027401e8de40d4c4567f082960682b50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3257, "upload_time": "2014-06-22T12:10:51", "url": "https://files.pythonhosted.org/packages/1d/08/bed05e83e389a4af1960c2c27d6e19211e051e0f2babc1f5944010c13e7e/object_cacher-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "ee15d39207686d05ed2f2b2c9916931d", "sha256": "fc5a76a6b7f1bd57325a2d8e9a62e93ba6bb088d09602db22dc19d95cbbfdfb8" }, "downloads": -1, "filename": "object_cacher-0.1.6.tar.gz", "has_sig": false, "md5_digest": "ee15d39207686d05ed2f2b2c9916931d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3262, "upload_time": "2014-06-22T12:11:54", "url": "https://files.pythonhosted.org/packages/97/e5/f4133b9be69a1245af256de7961f095e2c9ee52673910f1fc7e38c40f13c/object_cacher-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "419f5a450215211a3cddd6cf64b05194", "sha256": "f094bfc9d8ad4d3d6f32fcb3681c6db186e679c0256f3bd87e84fac847c65d09" }, "downloads": -1, "filename": "object_cacher-0.1.7.tar.gz", "has_sig": false, "md5_digest": "419f5a450215211a3cddd6cf64b05194", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3256, "upload_time": "2014-08-26T13:39:34", "url": "https://files.pythonhosted.org/packages/fc/dd/d8014e8a7b1d7c21bbfe08ea27f3beecb0384ea203d917593f103368e6e6/object_cacher-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "ef90990d7125f90203b67fb91bd23e63", "sha256": "05d007250c33df6dfcb78dcfbad91816295048bb7939191e61484bd5f57eb4f8" }, "downloads": -1, "filename": "object_cacher-0.1.8.tar.gz", "has_sig": false, "md5_digest": "ef90990d7125f90203b67fb91bd23e63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3437, "upload_time": "2014-08-26T13:48:15", "url": "https://files.pythonhosted.org/packages/d6/e0/d31a6142815f07f1e5887549761750163fc98b73a96073626238f971c5ab/object_cacher-0.1.8.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a894c5dbc6698cf8e1f022dbb9d248b3", "sha256": "fc5f4e423ddb22e6c47b7d3595a7fa4283b4931ad45f2c8c3054f11c817f03cb" }, "downloads": -1, "filename": "object_cacher-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a894c5dbc6698cf8e1f022dbb9d248b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3455, "upload_time": "2014-12-04T09:56:33", "url": "https://files.pythonhosted.org/packages/fe/b4/fb3ea2d6ed94af9f6dbcd885453b694b5385b928f358da54a639a86c60f3/object_cacher-0.2.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "e5ee1053ebe2712f3a0bb992df0f6eca", "sha256": "69996f88ac2bef118c1f2ac2ec0c8761caeec26762577eed915e478284f028c0" }, "downloads": -1, "filename": "object-cacher-0.3.1.tar.gz", "has_sig": false, "md5_digest": "e5ee1053ebe2712f3a0bb992df0f6eca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3798, "upload_time": "2015-04-09T19:36:08", "url": "https://files.pythonhosted.org/packages/84/3a/3bbd47ab4a2062c721fc8b1ee09c60c11027f45d3f2653c59724ca3736b3/object-cacher-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e5ee1053ebe2712f3a0bb992df0f6eca", "sha256": "69996f88ac2bef118c1f2ac2ec0c8761caeec26762577eed915e478284f028c0" }, "downloads": -1, "filename": "object-cacher-0.3.1.tar.gz", "has_sig": false, "md5_digest": "e5ee1053ebe2712f3a0bb992df0f6eca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3798, "upload_time": "2015-04-09T19:36:08", "url": "https://files.pythonhosted.org/packages/84/3a/3bbd47ab4a2062c721fc8b1ee09c60c11027f45d3f2653c59724ca3736b3/object-cacher-0.3.1.tar.gz" } ] }