{ "info": { "author": "John Whitlock", "author_email": "john@factorialfive.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "==========================================\nCached Instances for Django REST Framework\n==========================================\n\n\nSpeed up `Django REST Framework`_ (DRF) reads by storing instance data in cache.\n\nThis code was split from browsercompat_. You may be interested in\nviewing the browsercompat source code for a full example implementation.\n\n* Code: https://github.com/jwhitlock/drf-cached-instances\n* Free software: `Mozilla Public License Version 2.0`_\n* Documentation: https://drf-cached-instances.readthedocs.io\n\nHow it works\n------------\nIn a normal DRF view, a Django queryset is used to load an object or list of\nobjects. A serializer is used to convert the objects into the \"native\"\nrepresentation, and then a renderer works on this native representation. If\nthe serializer includes data from related models, then multiple database\nqueries may be required to generate a native representation. Some database\nefficiency can be gained by using ``select_related``, but a minimum of one query\nis needed, which is unfortunate for an API with heavy read usage.\n\nThis project replaces the Django queryset with a cache-aware proxy class,\nmaking it possible to serve a read request with zero database requests (to\nretrieve an instance) or one request (to get the primary keys for a list view).\nIt is suitable for APIs with heavy read operations and lots of linking between\nrelated instances.\n\nWhen using the cache, Django objects are serialized to JSON. Only the\nattributes needed for the DRF native representation are stored in the cache.\nThis include the JSON representation of fields such as foreign keys, reverse\nrelations, and dates and times. These serialized objects are stored by primary\nkey in the cache. When an instance is found in the cache, no database reads\nare needed to render the DRF representation. If the instance is not in the\ncache, it is serialized and stored, so that future reads will be faster.\n\nThe API implementor writes methods to handle JSON serialization, loading from\nthe database, and identifying invalid cache entries on changes. There are a\nfew integration points, including a mixin for views to load data from the cache.\nWith only a few changes to existing code, your read views could be a lot faster.\n\nProject status\n--------------\nThis code is used for the browsercompat_ project, which was developed from 2015\n- 2016, but is on hold as of August 2016. Since this was the primary user of\nthis code, it may be a while before more features are implemented.\n\n.. _`Django REST Framework`: http://www.django-rest-framework.org\n.. _`browsercompat`: https://github.com/mdn/browsercompat\n.. _`Mozilla Public License Version 2.0`: https://www.mozilla.org/MPL/2.0/\n\n\n\n\nHistory\n=======\n\n0.3.4 (2016-08-14)\n------------------\n* Drop support for Django 1.7, Python 2.6\n* Expand tests to Django 1.10, Django REST Framework 3.4, Python 3.5\n\n0.3.3 (2015-11-05)\n------------------\n* Add serializer for datetime.timedelta, to support Django 1.8's\n DurationField (creynold)\n* Convert string representations of datetimes, dates, and timedeltas\n* Expand tests to Django 1.9 beta 1 and Django REST Framework 3.3\n\n0.3.2 (2015-09-23)\n------------------\n* Remove deprecation warning in Django 1.8\n* Expand tests to Django master and Django REST Framework 3.2\n* Fix invalid mock.patch tests that break under mock 1.3.0\n* Documentation updates and fixes\n\n0.3.1 (2015-06-16)\n------------------\n* Move get_object_or_404 to mixin method, to allow easier extending.\n\n0.3.0 (2015-04-09)\n------------------\n* Tested with Django 1.8\n* Tested with Django REST Framework 2.4, 3.0, and 3.1\n* CachedModel now supports .pk attribute as an alias, usually to the .id\n field. DRF 3 uses .pk to determine if a model is saved to database, and\n returns empty relation data for unsaved fields.\n* cache.delete_all_versions() will delete all cached instances of a model and\n PK. This is useful when changes are made outside of normal requests, such as\n during a data migration.\n\n0.2.0 (2014-12-11)\n------------------\n* Add ``update_only`` option to ``cache.update_instance``, to support eventual\n consistency for cold caches.\n\n0.1.0 (2014-11-06)\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jwhitlock/drf-cached-instances", "keywords": "drf-cached-instances", "license": "MPL 2.0", "maintainer": null, "maintainer_email": null, "name": "drf-cached-instances", "package_url": "https://pypi.org/project/drf-cached-instances/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/drf-cached-instances/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jwhitlock/drf-cached-instances" }, "release_url": "https://pypi.org/project/drf-cached-instances/0.3.4/", "requires_dist": null, "requires_python": null, "summary": "Cached instances for Django REST Framework", "version": "0.3.4" }, "last_serial": 2281081, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5a55b4bbbc77faf75b5699bfe49edff4", "sha256": "3e8864c008728b2b39034b55f06d4cc683491d7da2662c8b0297c3d26b27d705" }, "downloads": -1, "filename": "drf_cached_instances-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5a55b4bbbc77faf75b5699bfe49edff4", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11282, "upload_time": "2014-11-06T20:45:31", "url": "https://files.pythonhosted.org/packages/e2/da/7d2a195a2eb828d332ad68fba02eba63723731a5094323129bd63994283b/drf_cached_instances-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1886886413d1546c6b49784eb19058a6", "sha256": "dc7da5d42a37e44786cab9f58cbdf3892eb686e473473699104c75a4a8d63d56" }, "downloads": -1, "filename": "drf-cached-instances-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1886886413d1546c6b49784eb19058a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38477, "upload_time": "2014-11-06T20:45:28", "url": "https://files.pythonhosted.org/packages/07/2d/a6cb850b11b5723206d8b0306cb2358fa1a083efa96d0965de5f93dfbb8d/drf-cached-instances-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "60c9b69ab57e880505cd698b465c4822", "sha256": "d40630bbda761ea853b0fda036d1e0376bd0cb156fa5b34f2c0742973d18d481" }, "downloads": -1, "filename": "drf_cached_instances-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "60c9b69ab57e880505cd698b465c4822", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11555, "upload_time": "2014-12-11T17:15:27", "url": "https://files.pythonhosted.org/packages/41/40/f814d94e22f2117300353f7e07f21070ee6d6ca10d3fc9c1209db00ac4a3/drf_cached_instances-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ed4389b0f496bca709b5fa6eb5d5b33", "sha256": "8002ded3cb5eb7e67f76cb04d5d08103173686346f1ab9410a1ccf416c4c2fcf" }, "downloads": -1, "filename": "drf-cached-instances-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0ed4389b0f496bca709b5fa6eb5d5b33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39143, "upload_time": "2014-12-11T17:15:29", "url": "https://files.pythonhosted.org/packages/af/d7/f32982d33b7c2c089b2768eccdef242ba1443a694207a0de2c6473bdcd63/drf-cached-instances-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "93ee7fe749c0356bda7f4c68a4a455ae", "sha256": "37d266012d6ae5fba30837f6c3c94d128d458451834f6c93edec67eb49208987" }, "downloads": -1, "filename": "drf_cached_instances-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "93ee7fe749c0356bda7f4c68a4a455ae", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11420, "upload_time": "2015-04-09T16:02:12", "url": "https://files.pythonhosted.org/packages/5b/a8/768525101f1d3d136bee93d26f774533463725e34013c8075d73481e55ce/drf_cached_instances-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b044c63ea826eda5ce902dda09a01d96", "sha256": "04a853365c6a2a3c0167bf11bfc234940dc1daa11cbe6ee421e7f70db3ff2c00" }, "downloads": -1, "filename": "drf-cached-instances-0.3.0.tar.gz", "has_sig": false, "md5_digest": "b044c63ea826eda5ce902dda09a01d96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39473, "upload_time": "2015-04-09T16:02:09", "url": "https://files.pythonhosted.org/packages/36/c7/181daf14780ef9a206e7747710260b84ff59fba47ccac37f73ae681a02f4/drf-cached-instances-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "eafb3ceb66b166b0e8a2a124cd28c873", "sha256": "2920a622c80176cb33bf9be0dd78f6d8d618fda3e2a2abbfe89d1ee31d7eaf88" }, "downloads": -1, "filename": "drf_cached_instances-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eafb3ceb66b166b0e8a2a124cd28c873", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11527, "upload_time": "2015-06-17T13:52:54", "url": "https://files.pythonhosted.org/packages/92/ee/f26f30413640645c252e80d8c743aec292affe66b215b1ec1a46e64e9568/drf_cached_instances-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fd66cf77a0853c9e8cc8ce132114dc85", "sha256": "7f9ae19fe811fd6e88cd0a0ae66928fcd92f98445df5ea8ffc9fe484590eacae" }, "downloads": -1, "filename": "drf-cached-instances-0.3.1.tar.gz", "has_sig": false, "md5_digest": "fd66cf77a0853c9e8cc8ce132114dc85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39506, "upload_time": "2015-06-17T13:52:51", "url": "https://files.pythonhosted.org/packages/1a/70/02f8f4fa10bc73400ed0e1a6c2056f7f3d01b7727cb229c1afb8fd3a3be0/drf-cached-instances-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "72a2d4f7d2751e2c4731d28c7439ca04", "sha256": "90999bcbe44e0f99cfd2228d8beeb4631eb6fa9e5eb2c952c5ee25ca4c1d18ff" }, "downloads": -1, "filename": "drf_cached_instances-0.3.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "72a2d4f7d2751e2c4731d28c7439ca04", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11770, "upload_time": "2015-09-23T18:18:26", "url": "https://files.pythonhosted.org/packages/79/ec/cf62eeab2b3474915b298e09e3b30057f8ff03f19b339b629b31cdb0cbb7/drf_cached_instances-0.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "10e4fa717e03182ff0138f20991092b8", "sha256": "58cae85327d5c0002662a8a5fe72466e5c785e47d432779ec29e88b8cc404e5e" }, "downloads": -1, "filename": "drf-cached-instances-0.3.2.tar.gz", "has_sig": false, "md5_digest": "10e4fa717e03182ff0138f20991092b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39482, "upload_time": "2015-09-23T18:18:22", "url": "https://files.pythonhosted.org/packages/ba/6e/efdb11dd2f65ddef52036bc121d37dda025342058050e94f10256b35233c/drf-cached-instances-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "ca17e4051a72a8ec9b5050d0a2949a62", "sha256": "c924c8d2ee4b9b62df3919180cb3b4b969dd547a07179bd3e96637973c3fc677" }, "downloads": -1, "filename": "drf_cached_instances-0.3.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ca17e4051a72a8ec9b5050d0a2949a62", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13224, "upload_time": "2015-11-05T17:06:30", "url": "https://files.pythonhosted.org/packages/bf/26/59e41c08706dce28c900edae02f98d8a3f8932c9583c94428e8435b01d4b/drf_cached_instances-0.3.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0648e5ac943c4991de03e87de937b2b2", "sha256": "e34ad8be712f6a72f0011956a8a4cfb1a096839f9ef5e1db74f7a10896304e88" }, "downloads": -1, "filename": "drf-cached-instances-0.3.3.tar.gz", "has_sig": false, "md5_digest": "0648e5ac943c4991de03e87de937b2b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41090, "upload_time": "2015-11-05T17:06:23", "url": "https://files.pythonhosted.org/packages/cd/48/70c549a7d69da040753fbe720af3ffebf2557b39f82b3cfc32ee0f39ed82/drf-cached-instances-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "895344624ff4efc7024716a055669c2a", "sha256": "d07200254a43c407bffc92c088ea592284f34cffe0add0c5aa48e6daf273d24c" }, "downloads": -1, "filename": "drf_cached_instances-0.3.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "895344624ff4efc7024716a055669c2a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13141, "upload_time": "2016-08-14T21:13:58", "url": "https://files.pythonhosted.org/packages/d4/e1/66daaf608326b2dcc50fb52d699bcd462ea441cd6941c6bc83ed9f8b3553/drf_cached_instances-0.3.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "638116b97283faabdd5a82e24c527511", "sha256": "63c81f04b9624997005f9b1e1b125e5465cc0fc46b870f3a128f7975ab49d890" }, "downloads": -1, "filename": "drf-cached-instances-0.3.4.tar.gz", "has_sig": false, "md5_digest": "638116b97283faabdd5a82e24c527511", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40881, "upload_time": "2016-08-14T21:13:55", "url": "https://files.pythonhosted.org/packages/25/66/d4fa2347c2b22b7cb5a11f3d5fb27913b154d75d38cf86d9c1206e8e3b8c/drf-cached-instances-0.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "895344624ff4efc7024716a055669c2a", "sha256": "d07200254a43c407bffc92c088ea592284f34cffe0add0c5aa48e6daf273d24c" }, "downloads": -1, "filename": "drf_cached_instances-0.3.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "895344624ff4efc7024716a055669c2a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13141, "upload_time": "2016-08-14T21:13:58", "url": "https://files.pythonhosted.org/packages/d4/e1/66daaf608326b2dcc50fb52d699bcd462ea441cd6941c6bc83ed9f8b3553/drf_cached_instances-0.3.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "638116b97283faabdd5a82e24c527511", "sha256": "63c81f04b9624997005f9b1e1b125e5465cc0fc46b870f3a128f7975ab49d890" }, "downloads": -1, "filename": "drf-cached-instances-0.3.4.tar.gz", "has_sig": false, "md5_digest": "638116b97283faabdd5a82e24c527511", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40881, "upload_time": "2016-08-14T21:13:55", "url": "https://files.pythonhosted.org/packages/25/66/d4fa2347c2b22b7cb5a11f3d5fb27913b154d75d38cf86d9c1206e8e3b8c/drf-cached-instances-0.3.4.tar.gz" } ] }