{"id":13502286,"url":"https://github.com/yola/property-caching","last_synced_at":"2026-04-02T02:12:09.900Z","repository":{"id":7512758,"uuid":"8863051","full_name":"yola/property-caching","owner":"yola","description":"Decorators for caching properties on objects","archived":false,"fork":false,"pushed_at":"2016-03-29T20:52:17.000Z","size":29,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-09-17T19:56:55.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yola.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-18T20:08:58.000Z","updated_at":"2024-11-28T16:26:55.000Z","dependencies_parsed_at":"2022-09-04T10:11:18.230Z","dependency_job_id":null,"html_url":"https://github.com/yola/property-caching","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/yola/property-caching","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yola%2Fproperty-caching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yola%2Fproperty-caching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yola%2Fproperty-caching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yola%2Fproperty-caching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yola","download_url":"https://codeload.github.com/yola/property-caching/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yola%2Fproperty-caching/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:02:08.653Z","updated_at":"2026-04-02T02:12:09.870Z","avatar_url":"https://github.com/yola.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Property caching\n================\n.. image:: https://travis-ci.org/yola/property-caching.svg?branch=fix/md-to-rst\n    :target: https://travis-ci.org/yola/property-caching\n\n\nCached version of property\n\nWritten and used by the folks at Yola to support our `free website\nbuilder`_.\n\nOverview\n--------\n\n-  ``cached_property`` - stores results of decorated methods in\n   decorated object\n   (in ``_cached_properties`` attribute)\n-  ``class_cached_property`` - stores results of decorated methods in\n   the class of decorated object\n   (in ``_class_cached_properties`` attribute). All instances will share\n   cached value.\n-  ``clear_property_cache`` - deletes cached value (works for object\n   cached properties only)\n-  ``set_property_cache`` - explicitly sets property cache (works for\n   object cached properties only)\n-  ``is_property_cached`` - allows to check whether property was cached\n   or not (works for object cached properties only)\n\nUsage\n-----\n\n.. code:: python\n\n    from property_caching import (cached_property,\n                                  class_cached_property,\n                                  clear_property_cache,\n                                  set_property_cache,\n                                  truthy_cached_property)\n\n    class Dummy:\n        @cached_property\n        def foo(self):\n            return self.service.expensive_operation()\n\n        @truthy_cached_property\n        def bar(self):\n            # this value will only be cached if it doesn't evaluate to false:\n            return self.service.expensive_operation2()\n\n        @class_cached_property\n        def service(self):\n            return expensive_service_initialization()\n\n    d = Dummy()\n    d.foo   # calculates result and stores it in d._cached_properties\n    d.foo   # uses cached value\n\n    clear_property_cache(d, 'foo')   # clears cache for property `foo`\n    set_property_cache(d, 'foo', 42) # explicitly set cache for property `foo`\n\n    d2 = Dummy()\n    d2.foo  # re-calculates value of `foo` but uses cached service\n\nTesting\n-------\n\nInstall development requirements:\n\n::\n\n    pip install -r requirements.txt\n\nRun the tests with:\n\n::\n\n    python setup.py test\n\n.. _free website builder: https://www.yola.com/\n\n.. image:: https://travis-ci.org/yola/property-caching.svg?branch=fix/md-to-rst\n    :target: https://travis-ci.org/yola/property-caching\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyola%2Fproperty-caching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyola%2Fproperty-caching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyola%2Fproperty-caching/lists"}