{"id":30873557,"url":"https://github.com/duboviy/minicache","last_synced_at":"2025-09-07T23:11:38.325Z","repository":{"id":46655459,"uuid":"70338660","full_name":"duboviy/minicache","owner":"duboviy","description":":package: Python memory caching utilities","archived":false,"fork":false,"pushed_at":"2020-04-26T19:46:33.000Z","size":106,"stargazers_count":79,"open_issues_count":0,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-27T08:35:38.370Z","etag":null,"topics":["cache","caching","python","utility"],"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/duboviy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2016-10-08T15:01:52.000Z","updated_at":"2025-05-10T16:21:25.000Z","dependencies_parsed_at":"2022-08-29T15:10:27.748Z","dependency_job_id":null,"html_url":"https://github.com/duboviy/minicache","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/duboviy/minicache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duboviy%2Fminicache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duboviy%2Fminicache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duboviy%2Fminicache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duboviy%2Fminicache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duboviy","download_url":"https://codeload.github.com/duboviy/minicache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duboviy%2Fminicache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274107977,"owners_count":25223473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"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":["cache","caching","python","utility"],"created_at":"2025-09-07T23:11:35.206Z","updated_at":"2025-09-07T23:11:38.312Z","avatar_url":"https://github.com/duboviy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\u003cimg src=\"https://raw.githubusercontent.com/duboviy/minicache/master/logo.png\" height=85 alt=\"logo\" title=\"logo\"\u003e minicache\u003c/h1\u003e\n\nPython memory caching utilities for Python 2 and 3 versions, also PyPy.\n\nby [Eugene Duboviy](https://duboviy.github.io/)\n\n[![Build Status](https://travis-ci.org/duboviy/minicache.svg?branch=master)](https://travis-ci.org/duboviy/minicache) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/667addd4539b4c53beb5a55864386a09)](https://www.codacy.com/app/dubovoy/minicache?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=duboviy/minicache\u0026amp;utm_campaign=Badge_Grade) [![PyPI](https://img.shields.io/pypi/v/minicache.svg)](https://pypi.python.org/pypi/minicache) [![Code Health](https://landscape.io/github/duboviy/minicache/master/landscape.svg?style=flat)](https://landscape.io/github/duboviy/minicache/master) [![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/duboviy/minicache/) [![PRs \u0026 Issues Welcome](https://img.shields.io/badge/PRs%20\u0026%20Issues-welcome-brightgreen.svg)](https://github.com/duboviy/minicache/pulls) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/duboviy/minicache/)\n\n## Why?\n\nA major problem of [funcy.memoize](http://funcy.readthedocs.org/en/stable/calc.html#memoize) you couldn't test with it because there was no (obvious) way to turn it off.\nThis project was created to suit the \"memoization\" needs, with a hook to turn it off (for testing or other purposes).\n\n## Current features\n\n* Simple set and get workflow\n* Decorator for \"memoization\" class methods and functions\n* Enabling and disabling functionality (including a context manager)\n* No additional packages required to be installed (using only standard python lib)\n\n## Installation\n\nInstall from PyPI:\n```\npip install minicache\n```\nOr using alternative command:\n```\npip install https://github.com/duboviy/minicache/archive/master.zip\n```\nOr from source use:\n```\npython setup.py install\n```\n\n## Supported python versions\n\n  * 2.7\n  * 3.3\n  * 3.4\n  * 3.5\n  * PyPy\n\n## PyPI\n\n* [Package](https://pypi.python.org/pypi/minicache)\n* [Documentation](https://pythonhosted.org/minicache/)\n\n## Examples\n\nBasic usage\n```python\n\u003e\u003e\u003e from minicache import cache\n\u003e\u003e\u003e cache.has('key')\nFalse\n\u003e\u003e\u003e cache.get('key', default='default')\n'default'\n\u003e\u003e\u003e cache.update('key', 'value')\n\u003e\u003e\u003e cache.get('key')\n'value'\n\u003e\u003e\u003e cache.disable()\n\u003e\u003e\u003e cache.get('key')\n```\n\nDecorator and context manager\n```python\nfrom minicache import cache\nimport time\n\n@cache.this\ndef somefunc():\n    time.sleep(5)\n    return \"this will be cached, and you won't have to wait a second time!\"\n\ndef test_somefunc():\n    somefunc()\n    somefunc()\n    with cache.temporarily_disabled():\n        # now we'll have to wait again\n        somefunc()\n```\n\nDecorator for \"memoization\" class methods:\n```python\nclass Foo(Cacheable):\n    def __init__(self):\n        super(Foo, self).__init__()\n        self._bar = 5\n\n    @property\n    @Cacheable.cached\n    def m1(self):\n        print('actual call property...', self._bar)\n        return self._bar\n\n    @Cacheable.cached\n    def m2(self, a, b, k=4, m=10):\n        s = a + b + k + m\n        print('actual call method...', a, b, k, m, s)\n        return s\n\n    @Cacheable.cached\n    def m3(self, a=3, b=2):\n        s = a + b\n        print('actual call method (kwargs only)', a, b, s)\n        return s\n```\n\n... and many other features\n\n\n## License\n\n**MIT** licensed library. See [LICENSE](LICENSE) for details.\n\n## Contributing\n\nIf you have suggestions for improving the minicache, please [open an issue or\npull request on GitHub](https://github.com/duboviy/minicache/).\n\n## Badges\n\n[![forthebadge](http://forthebadge.com/images/badges/fuck-it-ship-it.svg)](https://github.com/duboviy/minicache/)\n[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/duboviy/minicache/) [![forthebadge](http://forthebadge.com/images/badges/built-by-hipsters.svg)](https://github.com/duboviy/minicache/) [![forthebadge](http://forthebadge.com/images/badges/built-with-swag.svg)](https://github.com/duboviy/minicache/)\n\n[![forthebadge](http://forthebadge.com/images/badges/powered-by-electricity.svg)](https://github.com/duboviy/minicache/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-oxygen.svg)](https://github.com/duboviy/minicache/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-water.svg)](https://github.com/duboviy/minicache/) [![forthebadge](http://forthebadge.com/images/badges/powered-by-responsibility.svg)](https://github.com/duboviy/minicache/)\n\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)\n\n[![forthebadge](http://forthebadge.com/images/badges/makes-people-smile.svg)](https://github.com/duboviy/minicache/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduboviy%2Fminicache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduboviy%2Fminicache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduboviy%2Fminicache/lists"}