---
# Shelve Caching Decorator
## Overview
This Python package provides a decorator leveraging Shelve for persistent caching. The decorator allows efficient caching of function results, improving performance by storing data persistently between program executions.
## Features
- **Persistent Caching:** Utilizes Shelve for persistent storage of cached function results.
- **Efficient Performance:** Caches function results to avoid recomputation, enhancing performance for repeated calls.
- **Easy Integration:** Simple decorator syntax for easy integration with existing functions.
- **Customizable:** Easily configurable to cache functions with different argument combinations.
## Installation
You can install the package using pip:
```bash
pip install shelve-caching-decorator
```
## Usage
1. **Decorator Application:** Use the `@persistent_cache` decorator to cache function results.
```python
from shelvecache import persistent_cache
@persistent_cache("cache.db")
def expensive_operation(x, y):
# Your expensive computation here
return x * y
result = expensive_operation(2, 3) # Function result cached
```
2. **Persistent Storage:** The cached results are stored in the specified Shelve file ("cache.db" in the example above), ensuring persistence between program executions.
## Examples
Check the [examples](examples/) directory for detailed usage examples.
## Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
Feel free to customize and expand upon this README as needed for your repository!
Raw data
{
"_id": null,
"home_page": null,
"name": "shelve-cache",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, cache, shelve, decorator, sockets",
"author": "Sanchit Singh",
"author_email": "<sanchitsingh849@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/84/b8/5615924307bf5ef331c0e60c18b429263937fbda91cdb4295d1552f8b308/shelve_cache-0.0.4.tar.gz",
"platform": null,
"description": "\n---\n\n# Shelve Caching Decorator\n\n## Overview\n\nThis Python package provides a decorator leveraging Shelve for persistent caching. The decorator allows efficient caching of function results, improving performance by storing data persistently between program executions.\n\n## Features\n\n- **Persistent Caching:** Utilizes Shelve for persistent storage of cached function results.\n- **Efficient Performance:** Caches function results to avoid recomputation, enhancing performance for repeated calls.\n- **Easy Integration:** Simple decorator syntax for easy integration with existing functions.\n- **Customizable:** Easily configurable to cache functions with different argument combinations.\n\n## Installation\n\nYou can install the package using pip:\n\n```bash\npip install shelve-caching-decorator\n```\n\n## Usage\n\n1. **Decorator Application:** Use the `@persistent_cache` decorator to cache function results.\n\n ```python\n from shelvecache import persistent_cache\n\n @persistent_cache(\"cache.db\")\n def expensive_operation(x, y):\n # Your expensive computation here\n return x * y\n\n result = expensive_operation(2, 3) # Function result cached\n ```\n\n2. **Persistent Storage:** The cached results are stored in the specified Shelve file (\"cache.db\" in the example above), ensuring persistence between program executions.\n\n## Examples\n\nCheck the [examples](examples/) directory for detailed usage examples.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues or pull requests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nFeel free to customize and expand upon this README as needed for your repository!\n",
"bugtrack_url": null,
"license": null,
"summary": "Persistant decorator",
"version": "0.0.4",
"project_urls": null,
"split_keywords": [
"python",
" cache",
" shelve",
" decorator",
" sockets"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0db19c83ba8e1712e89efb8050546928a41c4f2617ee2f8d8821f4c9a551ba51",
"md5": "06e6128c242b834d710826bf3760c132",
"sha256": "9697abcc128c2a44fab66d6ba1ba0e6a853059a89c4d37d07edb7f89c75b91e8"
},
"downloads": -1,
"filename": "shelve_cache-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "06e6128c242b834d710826bf3760c132",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3855,
"upload_time": "2024-04-14T16:35:33",
"upload_time_iso_8601": "2024-04-14T16:35:33.184508Z",
"url": "https://files.pythonhosted.org/packages/0d/b1/9c83ba8e1712e89efb8050546928a41c4f2617ee2f8d8821f4c9a551ba51/shelve_cache-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "84b85615924307bf5ef331c0e60c18b429263937fbda91cdb4295d1552f8b308",
"md5": "796f3b68208b1428f58502124a251f9b",
"sha256": "f139f1b85d4232a0e8ed53b9b2e42d658e0b7771cfaa960c9e08eadd8da5dce0"
},
"downloads": -1,
"filename": "shelve_cache-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "796f3b68208b1428f58502124a251f9b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3529,
"upload_time": "2024-04-14T16:35:34",
"upload_time_iso_8601": "2024-04-14T16:35:34.355468Z",
"url": "https://files.pythonhosted.org/packages/84/b8/5615924307bf5ef331c0e60c18b429263937fbda91cdb4295d1552f8b308/shelve_cache-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-14 16:35:34",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "shelve-cache"
}